commit: 690b4314ceaafb8bce748b5be9704f3d6abcee61
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 5 04:37:10 2014 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 1 21:49:41 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=690b4314
emaint sync: Fix bug 522032, add a one time only post-sync hook call
After all repos have been synced, the emaint sync module runs another post-sync
hook call
passing it the 'PORTAGE_SYNC_HOOK_FINAL' value as the url.
This value can be read by the post-sync hook to decide if it needs to run or
pass.
This allows flexible, precise control over post-sync hooks for multiple
repositories.
Caveat: Current app-portage/portage-utils post_sync hook script does not pass
on the url
to the postsync.d/* scripts that it intiates.
---
pym/portage/emaint/modules/sync/sync.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pym/portage/emaint/modules/sync/sync.py
b/pym/portage/emaint/modules/sync/sync.py
index b657133..9b0d82c 100644
--- a/pym/portage/emaint/modules/sync/sync.py
+++ b/pym/portage/emaint/modules/sync/sync.py
@@ -192,10 +192,13 @@ class SyncRepos(object):
msgs.extend(self._check_updates())
display_news_notification(self.emerge_config.target_config,
self.emerge_config.opts)
+ rcode =
sync_manager.perform_post_sync_hook('PORTAGE_SYNC_HOOK_FINAL')
if retvals:
msgs.extend(self.rmessage(retvals, 'sync'))
else:
msgs.append(self.rmessage(('None', os.EX_OK), 'sync'))
+ if rcode:
+ msgs.append(self.rmessage('None', rcode), 'post-sync')
if return_messages:
return msgs
return