summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-07-07 12:48:00 -0700
committerZac Medico <zmedico@gentoo.org>2013-07-07 12:48:00 -0700
commit5e219db214a3b33fe6e277bfd18dae82c0295e0b (patch)
tree445257ea962e5c86398cfc714738c117b0cf0aab
parentdoebuild: handle tmpdir / returnpid interaction (diff)
downloadportage-5e219db214a3b33fe6e277bfd18dae82c0295e0b.tar.gz
portage-5e219db214a3b33fe6e277bfd18dae82c0295e0b.tar.bz2
portage-5e219db214a3b33fe6e277bfd18dae82c0295e0b.zip
doebuild: support 'nofetch' phase
-rw-r--r--bin/phase-functions.sh1
-rw-r--r--pym/portage/package/ebuild/_spawn_nofetch.py6
-rw-r--r--pym/portage/package/ebuild/doebuild.py12
-rw-r--r--pym/portage/tests/ebuild/test_doebuild_fd_pipes.py3
4 files changed, 18 insertions, 4 deletions
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 6433c545e..5c172437f 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -622,6 +622,7 @@ __dyn_help() {
echo " pretend : execute package specific pretend actions"
echo " setup : execute package specific setup actions"
echo " fetch : download source archive(s) and patches"
+ echo " nofetch : display special fetch instructions"
echo " digest : create a manifest file for the package"
echo " manifest : create a manifest file for the package"
echo " unpack : unpack sources (auto-dependencies if needed)"
diff --git a/pym/portage/package/ebuild/_spawn_nofetch.py b/pym/portage/package/ebuild/_spawn_nofetch.py
index a8814a5bd..0fc53c8ca 100644
--- a/pym/portage/package/ebuild/_spawn_nofetch.py
+++ b/pym/portage/package/ebuild/_spawn_nofetch.py
@@ -50,7 +50,7 @@ def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
settings = config(clone=settings)
if 'PORTAGE_PARALLEL_FETCHONLY' in settings:
- return
+ return os.EX_OK
# We must create our private PORTAGE_TMPDIR before calling
# doebuild_environment(), since lots of variables such
@@ -76,7 +76,7 @@ def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
if 'fetch' not in restrict and \
'nofetch' not in defined_phases:
- return
+ return os.EX_OK
prepare_build_dirs(settings=settings)
ebuild_phase = EbuildPhase(background=False,
@@ -89,3 +89,5 @@ def spawn_nofetch(portdb, ebuild_path, settings=None, fd_pipes=None):
elog_process(settings.mycpv, settings)
finally:
shutil.rmtree(private_tmpdir)
+
+ return ebuild_phase.returncode
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index edf3df6ab..06ea1115b 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -574,7 +574,7 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
"fetch", "fetchall", "digest",
"unpack", "prepare", "configure", "compile", "test",
"install", "rpm", "qmerge", "merge",
- "package","unmerge", "manifest"]
+ "package", "unmerge", "manifest", "nofetch"]
if mydo not in validcommands:
validcommands.sort()
@@ -745,6 +745,16 @@ def doebuild(myebuild, mydo, _unused=DeprecationWarning, settings=None, debug=0,
return _spawn_phase(mydo, mysettings,
fd_pipes=fd_pipes, returnpid=returnpid)
+ elif mydo == "nofetch":
+
+ if returnpid:
+ writemsg("!!! doebuild: %s\n" %
+ _("returnpid is not supported for phase '%s'\n" % mydo),
+ noiselevel=-1)
+
+ return spawn_nofetch(mydbapi, myebuild, settings=mysettings,
+ fd_pipes=fd_pipes)
+
if tree == "porttree":
if not returnpid:
diff --git a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
index ddd73e2ba..6fdda5fea 100644
--- a/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
+++ b/pym/portage/tests/ebuild/test_doebuild_fd_pipes.py
@@ -33,6 +33,7 @@ class DoebuildFdPipesTestCase(TestCase):
ebuild_body = textwrap.dedent("""
S=${WORKDIR}
+ pkg_nofetch() { echo nofetch ; }
pkg_pretend() { echo pretend ; }
pkg_setup() { echo setup ; }
src_unpack() { echo unpack ; }
@@ -78,7 +79,7 @@ class DoebuildFdPipesTestCase(TestCase):
self.assertNotEqual(ebuildpath, None)
for phase in ('pretend', 'setup', 'unpack', 'prepare', 'configure',
- 'compile', 'test', 'install', 'clean', 'merge'):
+ 'compile', 'test', 'install', 'clean', 'merge', 'nofetch'):
pr, pw = os.pipe()