summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-08 06:49:34 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-08 06:49:34 +0000
commit536eead0b367f9365d1d1574aff3a37a56b96d47 (patch)
tree9086aa5f81a2f781de19cc392dcf3dc3ae51f988 /pym
parentfebc42619eb21131e8b669130273e8a3e91cb8c3 (diff)
downloadportage-536eead0b367f9365d1d1574aff3a37a56b96d47.tar.gz
portage-536eead0b367f9365d1d1574aff3a37a56b96d47.tar.bz2
portage-536eead0b367f9365d1d1574aff3a37a56b96d47.zip
* Fix the default() implementation so that it maps the ebuild argument to
the correct phase function. * Add --exclude-init-phases option to save_ebuild_env() for filtering out unnecessary functions and variables when creating environment.bz2. * Add support for default() and default_* functions that die in all ebuild phases so that improper use of these functions is quickly discovered. svn path=/main/trunk/; revision=11346
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py12
-rw-r--r--pym/portage/const.py2
2 files changed, 11 insertions, 3 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 4656a5de7..15766f9a0 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -4042,8 +4042,16 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
"ebuild's files must be downloaded"
print "!!! manually. See the comments in" + \
" the ebuild for more information.\n"
- mysettings["EBUILD_PHASE"] = "unpack"
- spawn(EBUILD_SH_BINARY + " nofetch", mysettings)
+ ebuild_phase = mysettings.get("EBUILD_PHASE")
+ try:
+ mysettings["EBUILD_PHASE"] = "nofetch"
+ spawn(_shell_quote(EBUILD_SH_BINARY) + \
+ " nofetch", mysettings)
+ finally:
+ if ebuild_phase is None:
+ mysettings.pop("EBUILD_PHASE", None)
+ else:
+ mysettings["EBUILD_PHASE"] = ebuild_phase
elif listonly:
continue
elif not filedict[myfile]:
diff --git a/pym/portage/const.py b/pym/portage/const.py
index 19d858b11..2958cf3ce 100644
--- a/pym/portage/const.py
+++ b/pym/portage/const.py
@@ -58,7 +58,7 @@ INCREMENTALS = ["USE", "USE_EXPAND", "USE_EXPAND_HIDDEN", "FEATURES",
EBUILD_PHASES = ["setup", "unpack", "configure",
"compile", "test", "install",
"package", "preinst", "postinst","prerm", "postrm",
- "other"]
+ "nofetch", "other"]
EAPI = 1