commit: 3ba858e6079858f2cc762ab1a65304291aeb4b40 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Fri Sep 5 04:37:10 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Tue Sep 30 00:42:27 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=3ba858e6
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