1 |
commit: 23f239134b0290cbe0435e13d8f1b1757c6d8524 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 23 00:31:51 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 23 00:40:37 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=23f23913 |
7 |
|
8 |
action_sync: fix TypeError: 'int' object is not subscriptable (bug 606588) |
9 |
|
10 |
Handle the tuple returned from SyncRepos._sync since commit |
11 |
f143e58dd3fd80ab67121e7a62e8cf47151d3907. Also fix the |
12 |
SyncRepos._sync method to prevent corruption of the returncode |
13 |
variable. |
14 |
|
15 |
Fixes: f143e58dd3fd ("emaint: exit with non-zero status code when module fails (bug 567478)") |
16 |
X-Gentoo-Bug: 606588 |
17 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=606588 |
18 |
|
19 |
pym/_emerge/actions.py | 6 ++---- |
20 |
pym/portage/emaint/modules/sync/sync.py | 4 ++-- |
21 |
2 files changed, 4 insertions(+), 6 deletions(-) |
22 |
|
23 |
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py |
24 |
index 6704afc..ccb6a5d 100644 |
25 |
--- a/pym/_emerge/actions.py |
26 |
+++ b/pym/_emerge/actions.py |
27 |
@@ -2000,11 +2000,9 @@ def action_sync(emerge_config, trees=DeprecationWarning, |
28 |
syncer = SyncRepos(emerge_config) |
29 |
|
30 |
|
31 |
- retvals = syncer.auto_sync(options={'return-messages': False}) |
32 |
+ success, msgs = syncer.auto_sync(options={'return-messages': False}) |
33 |
|
34 |
- if retvals: |
35 |
- return retvals[0][1] |
36 |
- return os.EX_OK |
37 |
+ return os.EX_OK if success else 1 |
38 |
|
39 |
|
40 |
def action_uninstall(settings, trees, ldpath_mtimes, |
41 |
|
42 |
diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py |
43 |
index d867699..b190b3c 100644 |
44 |
--- a/pym/portage/emaint/modules/sync/sync.py |
45 |
+++ b/pym/portage/emaint/modules/sync/sync.py |
46 |
@@ -236,8 +236,8 @@ class SyncRepos(object): |
47 |
|
48 |
if retvals: |
49 |
msgs.extend(self.rmessage(retvals, 'sync')) |
50 |
- for repo, returncode in retvals: |
51 |
- if returncode != os.EX_OK: |
52 |
+ for repo, retval in retvals: |
53 |
+ if retval != os.EX_OK: |
54 |
returncode = False |
55 |
break |
56 |
else: |