* [gentoo-portage-dev] [PATCH] SyncManager.sync: always return 4-tuple (bug 567932)
@ 2015-12-12 23:09 Zac Medico
2015-12-12 23:34 ` Brian Dolbec
0 siblings, 1 reply; 2+ messages in thread
From: Zac Medico @ 2015-12-12 23:09 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Zac Medico
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
---
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
--
2.4.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] SyncManager.sync: always return 4-tuple (bug 567932)
2015-12-12 23:09 [gentoo-portage-dev] [PATCH] SyncManager.sync: always return 4-tuple (bug 567932) Zac Medico
@ 2015-12-12 23:34 ` Brian Dolbec
0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2015-12-12 23:34 UTC (permalink / raw
To: gentoo-portage-dev
On Sat, 12 Dec 2015 15:09:43 -0800
Zac Medico <zmedico@gentoo.org> wrote:
> 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
> ---
> 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
yeah, looks good
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-12 23:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12 23:09 [gentoo-portage-dev] [PATCH] SyncManager.sync: always return 4-tuple (bug 567932) Zac Medico
2015-12-12 23:34 ` Brian Dolbec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox