summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-23 02:02:06 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-23 02:02:06 +0000
commit0e7a83b0946dc21d461a7c542267e2963354341e (patch)
tree6baebda06aacf81ab8483ec2d9f98d83bade8d30 /pym
parentc47730c0f2b6c9270382357d20f4a47322ad5da5 (diff)
downloadportage-0e7a83b0946dc21d461a7c542267e2963354341e.tar.gz
portage-0e7a83b0946dc21d461a7c542267e2963354341e.tar.bz2
portage-0e7a83b0946dc21d461a7c542267e2963354341e.zip
Add a new src_prepare phase function which is called in-between src_unpack
and src_configure (and bump EAPI to 2_pre3). Thanks to Ciaran McCreesh for the suggestion. svn path=/main/trunk/; revision=11454
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py10
-rw-r--r--pym/portage/__init__.py15
-rw-r--r--pym/portage/const.py2
3 files changed, 19 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index c6d8c71fd..333043d4d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -2588,7 +2588,7 @@ class EbuildExecuter(CompositeTask):
__slots__ = ("pkg", "scheduler", "settings") + ("_tree",)
- _phases = ("configure", "compile", "test", "install")
+ _phases = ("prepare", "configure", "compile", "test", "install")
_live_eclasses = frozenset([
"cvs",
@@ -2659,8 +2659,12 @@ class EbuildExecuter(CompositeTask):
pkg = self.pkg
phases = self._phases
- if pkg.metadata["EAPI"] in ("0", "1", "2_pre1"):
- # skip src_configure
+ eapi = pkg.metadata["EAPI"]
+ if eapi in ("0", "1", "2_pre1"):
+ # skip src_prepare and src_configure
+ phases = phases[2:]
+ elif eapi in ("2_pre2",):
+ # skip src_prepare
phases = phases[1:]
for phase in phases:
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index bcf710842..a97f1eec7 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4324,7 +4324,12 @@ def spawnebuild(mydo, actionmap, mysettings, debug, alwaysdep=0,
if retval:
return retval
- if mydo == "configure" and mysettings["EAPI"] in ("0", "1", "2_pre1"):
+ eapi = mysettings["EAPI"]
+
+ if mydo == "configure" and eapi in ("0", "1", "2_pre1"):
+ return os.EX_OK
+
+ if mydo == "prepare" and eapi in ("0", "1", "2_pre1", "2_pre2"):
return os.EX_OK
kwargs = actionmap[mydo]["args"]
@@ -4569,7 +4574,7 @@ def _spawn_misc_sh(mysettings, commands, **kwargs):
def eapi_is_supported(eapi):
eapi = str(eapi).strip()
- if eapi in ("2_pre2", "2_pre1"):
+ if eapi in ("2_pre3", "2_pre2", "2_pre1"):
return True
try:
@@ -5105,7 +5110,8 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
actionmap_deps={
"setup": [],
"unpack": ["setup"],
- "configure": ["unpack"],
+ "prepare": ["unpack"],
+ "configure": ["prepare"],
"compile":["configure"],
"test": ["compile"],
"install":["test"],
@@ -5127,7 +5133,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
validcommands = ["help","clean","prerm","postrm","cleanrm","preinst","postinst",
"config", "info", "setup", "depend",
"fetch", "fetchall", "digest",
- "unpack", "configure", "compile", "test",
+ "unpack", "prepare", "configure", "compile", "test",
"install", "rpm", "qmerge", "merge",
"package","unmerge", "manifest"]
@@ -5713,6 +5719,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
actionmap = {
"setup": {"cmd":ebuild_sh, "args":{"droppriv":0, "free":1, "sesandbox":0, "fakeroot":0}},
"unpack": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":0, "sesandbox":sesandbox, "fakeroot":0}},
+"prepare": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":0, "sesandbox":sesandbox, "fakeroot":0}},
"configure":{"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
"compile": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
"test": {"cmd":ebuild_sh, "args":{"droppriv":droppriv, "free":nosandbox, "sesandbox":sesandbox, "fakeroot":0}},
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 3cb1ef6d4..1b8b3036e 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -55,7 +55,7 @@ INCREMENTALS = ["USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES",
"ACCEPT_KEYWORDS", "ACCEPT_LICENSE",
"CONFIG_PROTECT_MASK", "CONFIG_PROTECT",
"PRELINK_PATH", "PRELINK_PATH_MASK", "PROFILE_ONLY_VARIABLES"]
-EBUILD_PHASES = ["setup", "unpack", "configure",
+EBUILD_PHASES = ["setup", "unpack", "prepare", "configure",
"compile", "test", "install",
"package", "preinst", "postinst","prerm", "postrm",
"nofetch", "config", "info", "other"]