commit:     32b372bf79633bbfe6c7b1f5bca2f290a32695d4
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 12 22:24:04 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Dec 12 23:40:41 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=32b372bf

SyncManager.sync: always return 4-tuple (bug 567932)

Since commit 496ff326dc18890889d1ea5d2aec590394635960, invalid repos.conf
settings or failure of the pre_sync method caused SyncManager.sync to
return an incorrect number of values.

Fixes: 496ff326dc18 ("sync repositories in parallel (bug 557426)")
X-Gentoo-Bug: 567932
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=567932
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/portage/sync/controller.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py
index e71ba67..92be3cb 100644
--- a/pym/portage/sync/controller.py
+++ b/pym/portage/sync/controller.py
@@ -129,16 +129,17 @@ class SyncManager(object):
                self.repo = repo
                self.exitcode = 1
                self.updatecache_flg = False
+               hooks_enabled = master_hooks or not 
repo.sync_hooks_only_on_change
                if repo.sync_type in self.module_names:
                        tasks = 
[self.module_controller.get_class(repo.sync_type)]
                else:
                        msg = "\n%s: Sync module '%s' is not an installed/known 
type'\n" \
                                % (bad("ERROR"), repo.sync_type)
-                       return self.exitcode, msg
+                       return self.exitcode, msg, self.updatecache_flg, 
hooks_enabled
 
                rval = self.pre_sync(repo)
                if rval != os.EX_OK:
-                       return rval, None
+                       return rval, None, self.updatecache_flg, hooks_enabled
 
                # need to pass the kwargs dict to the modules
                # so they are available if needed.
@@ -157,7 +158,6 @@ class SyncManager(object):
                taskmaster = TaskHandler(callback=self.do_callback)
                taskmaster.run_tasks(tasks, func, status, options=task_opts)
 
-               hooks_enabled = False
                if (master_hooks or self.updatecache_flg or
                        not repo.sync_hooks_only_on_change):
                        hooks_enabled = True

Reply via email to