commit: f9ae6e5a3de3dfdf536b5928c4ad5cfef376f1cc
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: Thu Dec 4 19:56:34 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f9ae6e5a
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 '' value as the repo name.
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 any parameters
to the postsync.d/* scripts that it intiates.
---
pym/portage/emaint/modules/sync/sync.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pym/portage/emaint/modules/sync/sync.py
b/pym/portage/emaint/modules/sync/sync.py
index b657133..86d16a3 100644
--- a/pym/portage/emaint/modules/sync/sync.py
+++ b/pym/portage/emaint/modules/sync/sync.py
@@ -192,10 +192,15 @@ class SyncRepos(object):
msgs.extend(self._check_updates())
display_news_notification(self.emerge_config.target_config,
self.emerge_config.opts)
+ # run the post_sync_hook one last time for
+ # run only at sync completion hooks
+ rcode = sync_manager.perform_post_sync_hook('')
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