commit: d3b91ee6493a9a5ac63e47e119ed7b73a2119e94 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Thu Dec 4 18:20:13 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Thu Dec 4 19:58:27 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d3b91ee6
emaint/modules/sync/sync.py: Fix a bug in the output if a specified repo did not exist --- pym/portage/emaint/modules/sync/sync.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py index 1dade6f..77c685c 100644 --- a/pym/portage/emaint/modules/sync/sync.py +++ b/pym/portage/emaint/modules/sync/sync.py @@ -9,7 +9,7 @@ import portage portage._internal_caller = True portage._sync_mode = True from portage.localization import _ -from portage.output import bold, create_color_func +from portage.output import bold, red, create_color_func from portage._global_updates import _global_updates from portage.sync.controller import SyncManager from portage.util import writemsg_level @@ -116,6 +116,13 @@ class SyncRepos(object): repos = repos.split() available = self._get_repos(auto_sync_only=False) selected = self._match_repos(repos, available) + if not selected: + msgs = [red(" * ") + "Emaint sync, The specified repos were not found: %s" + % (bold(", ".join(repos))) + "\n ...returning" + ] + if return_messages: + return msgs + return return self._sync(selected, return_messages) @@ -187,7 +194,8 @@ class SyncRepos(object): if not selected_repos: msgs.append("Emaint sync, nothing to sync... returning") if return_messages: - return msgs.append(self.rmessage(('None', os.EX_OK), 'sync')) + msgs.extend(self.rmessage([('None', os.EX_OK)], 'sync')) + return msgs return # Portage needs to ensure a sane umask for the files it creates. os.umask(0o22)