1 |
commit: 8ef3bfb4f187be83b39a779ca73da350e4780a25 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 5 04:37:10 2014 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Mon Sep 29 17:20:21 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ef3bfb4 |
7 |
|
8 |
emaint sync: Fix bug 522032, add a one time only post-sync hook call |
9 |
|
10 |
After all repos have been synced, the emaint sync module runs another post-sync hook call |
11 |
passing it the 'PORTAGE_SYNC_HOOK_FINAL' value as the url. |
12 |
This value can be read by the post-sync hook to decide if it needs to run or pass. |
13 |
This allows flexible, precise control over post-sync hooks for multiple repositories. |
14 |
|
15 |
Caveat: Current app-portage/portage-utils post_sync hook script does not pass on the url |
16 |
to the postsync.d/* scripts that it intiates. |
17 |
|
18 |
--- |
19 |
pym/portage/emaint/modules/sync/sync.py | 3 +++ |
20 |
1 file changed, 3 insertions(+) |
21 |
|
22 |
diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py |
23 |
index b657133..9b0d82c 100644 |
24 |
--- a/pym/portage/emaint/modules/sync/sync.py |
25 |
+++ b/pym/portage/emaint/modules/sync/sync.py |
26 |
@@ -192,10 +192,13 @@ class SyncRepos(object): |
27 |
msgs.extend(self._check_updates()) |
28 |
display_news_notification(self.emerge_config.target_config, |
29 |
self.emerge_config.opts) |
30 |
+ rcode = sync_manager.perform_post_sync_hook('PORTAGE_SYNC_HOOK_FINAL') |
31 |
if retvals: |
32 |
msgs.extend(self.rmessage(retvals, 'sync')) |
33 |
else: |
34 |
msgs.append(self.rmessage(('None', os.EX_OK), 'sync')) |
35 |
+ if rcode: |
36 |
+ msgs.append(self.rmessage('None', rcode), 'post-sync') |
37 |
if return_messages: |
38 |
return msgs |
39 |
return |