Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/sync/, pym/_emerge/
Date: Mon, 13 Feb 2017 08:55:27
Message-Id: 1486974980.f57ae38b978069e50c2b1bf2d41bffed23ecc11d.zmedico@gentoo
1 commit: f57ae38b978069e50c2b1bf2d41bffed23ecc11d
2 Author: Alexandru Elisei <alexandru.elisei <AT> gmail <DOT> com>
3 AuthorDate: Sat Feb 4 17:49:32 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 13 08:36:20 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f57ae38b
7
8 emerge: make emerge --sync print messages from SyncRepos.auto_sync()
9
10 Emerge will only display messages if --quiet is not set.
11
12 The word 'emaint' has been removed from two messages to avoid confusion.
13
14 pym/_emerge/actions.py | 7 +++++--
15 pym/portage/emaint/modules/sync/sync.py | 7 +++----
16 2 files changed, 8 insertions(+), 6 deletions(-)
17
18 diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
19 index ccb6a5d5e..71e362e3c 100644
20 --- a/pym/_emerge/actions.py
21 +++ b/pym/_emerge/actions.py
22 @@ -68,6 +68,7 @@ from portage._global_updates import _global_updates
23 from portage.sync.old_tree_timestamp import old_tree_timestamp_warn
24 from portage.localization import _
25 from portage.metadata import action_metadata
26 +from portage.emaint.main import print_results
27
28 from _emerge.clear_caches import clear_caches
29 from _emerge.countdown import countdown
30 @@ -1999,8 +2000,10 @@ def action_sync(emerge_config, trees=DeprecationWarning,
31
32 syncer = SyncRepos(emerge_config)
33
34 -
35 - success, msgs = syncer.auto_sync(options={'return-messages': False})
36 + return_messages = "--quiet" not in emerge_config.opts
37 + success, msgs = syncer.auto_sync(options={'return-messages': return_messages})
38 + if return_messages:
39 + print_results(msgs)
40
41 return os.EX_OK if success else 1
42
43
44 diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py
45 index c8d4ca1aa..08a92a7a8 100644
46 --- a/pym/portage/emaint/modules/sync/sync.py
47 +++ b/pym/portage/emaint/modules/sync/sync.py
48 @@ -123,9 +123,8 @@ class SyncRepos(object):
49 available = self._get_repos(auto_sync_only=False)
50 selected = self._match_repos(repos, available)
51 if not selected:
52 - msgs = [red(" * ") + "Emaint sync, The specified repos were not found: %s"
53 - % (bold(", ".join(repos))) + "\n ...returning"
54 - ]
55 + msgs = [red(" * ") + "The specified repos were not found: %s" %
56 + (bold(", ".join(repos))) + "\n ...returning"]
57 if return_messages:
58 return (False, msgs)
59 return (False, None)
60 @@ -208,7 +207,7 @@ class SyncRepos(object):
61 selected_repos = [repo for repo in selected_repos if repo.sync_type is not None]
62 msgs = []
63 if not selected_repos:
64 - msgs.append("Emaint sync, nothing to sync... returning")
65 + msgs.append("Nothing to sync... returning")
66 if return_messages:
67 msgs.extend(self.rmessage([('None', os.EX_OK)], 'sync'))
68 return (True, msgs)