summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-02-03 18:02:28 +0000
committerZac Medico <zmedico@gentoo.org>2009-02-03 18:02:28 +0000
commit340905a6bddc0aa905f88da3b0ca8e74406a82e9 (patch)
tree8739d5bc36461f631f343397ff3510a05fc008dc
parent18376646e10f3ee72a75287d851f9e8815e94956 (diff)
downloadportage-340905a6bddc0aa905f88da3b0ca8e74406a82e9.tar.gz
portage-340905a6bddc0aa905f88da3b0ca8e74406a82e9.tar.bz2
portage-340905a6bddc0aa905f88da3b0ca8e74406a82e9.zip
Make emerge --regen return non-zero if that are any failures. Thanks to Daniel
Robbins for reporting. svn path=/main/trunk/; revision=12575
-rw-r--r--pym/_emerge/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 5cb43bfe8..9cc9807a7 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -11145,6 +11145,8 @@ class MetadataRegen(PollScheduler):
self._valid_pkgs = set()
self._process_iter = self._iter_metadata_processes()
+ self.returncode = os.EX_OK
+ self._error_count = 0
def _iter_metadata_processes(self):
portdb = self._portdb
@@ -11222,6 +11224,8 @@ class MetadataRegen(PollScheduler):
def _metadata_exit(self, metadata_process):
self._jobs -= 1
if metadata_process.returncode != os.EX_OK:
+ self.returncode = 1
+ self._error_count += 1
self._valid_pkgs.discard(metadata_process.cpv)
portage.writemsg("Error processing %s, continuing...\n" % \
(metadata_process.cpv,))
@@ -12873,6 +12877,7 @@ def action_regen(settings, portdb, max_jobs, max_load):
regen.run()
portage.writemsg_stdout("done!\n")
+ return regen.returncode
def action_config(settings, trees, myopts, myfiles):
if len(myfiles) != 1:
@@ -15196,7 +15201,7 @@ def emerge_main():
action_metadata(settings, portdb, myopts)
elif myaction=="regen":
validate_ebuild_environment(trees)
- action_regen(settings, portdb, myopts.get("--jobs"),
+ return action_regen(settings, portdb, myopts.get("--jobs"),
myopts.get("--load-average"))
# HELP action
elif "config"==myaction: