From: "Brian Dolbec" <brian.dolbec@gmail.com> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/emaint/modules/sync/, pym/portage/sync/ Date: Thu, 4 Dec 2014 20:04:31 +0000 (UTC) [thread overview] Message-ID: <1417722994.b996dd99378c0e80c23361ec5d4eacee0bb936e6.dol-sen@gentoo> (raw) commit: b996dd99378c0e80c23361ec5d4eacee0bb936e6 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Fri Sep 5 20:08:36 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=b996dd99 portage/sync/controller.sync(): Migrate writemsg() call to return the error message to caller Highlight the "ERROR" string portion usig bad(), remove 1 linefeed. This puts the error in the emaint sync message list. --- pym/portage/emaint/modules/sync/sync.py | 6 +++--- pym/portage/sync/controller.py | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py index 86d16a3..c2847ae 100644 --- a/pym/portage/emaint/modules/sync/sync.py +++ b/pym/portage/emaint/modules/sync/sync.py @@ -179,11 +179,11 @@ class SyncRepos(object): sync_manager = get_syncer(self.emerge_config.target_config.settings, emergelog) retvals = [] for repo in selected_repos: - #print("syncing repo:", repo.name) if repo.sync_type is not None: - returncode = sync_manager.sync(self.emerge_config, repo) - #if returncode != os.EX_OK: + returncode, message = sync_manager.sync(self.emerge_config, repo) retvals.append((repo.name, returncode)) + if message: + msgs.append(message) # Reload the whole config. portage._sync_mode = False diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py index ddf48c8..10ae0a8 100644 --- a/pym/portage/sync/controller.py +++ b/pym/portage/sync/controller.py @@ -103,14 +103,13 @@ class SyncManager(object): if repo.sync_type in self.module_names[1:]: tasks = [self.module_controller.get_class(repo.sync_type)] else: - portage.util.writemsg( - "\nERROR: Sync module '%s' is not an installed/known type'\n\n" - % (repo.sync_type), noiselevel=-1) - return self.exitcode + msg = "\n%s: Sync module '%s' is not an installed/known type'\n" \ + % (bad("ERROR"), repo.sync_type) + return self.exitcode, msg rval = self.pre_sync(repo) if rval != os.EX_OK: - return rval + return rval, None # need to pass the kwargs dict to the modules # so they are available if needed. @@ -131,7 +130,7 @@ class SyncManager(object): self.perform_post_sync_hook(repo.sync_uri) - return self.exitcode + return self.exitcode, None def do_callback(self, result): @@ -168,7 +167,7 @@ class SyncManager(object): except OSError: st = None if st is None: - print(">>> '%s' not found, creating it." % repo.location) + writemsg_level(">>> '%s' not found, creating it." % repo.location) portage.util.ensure_dirs(repo.location, mode=0o755) st = os.stat(repo.location)
WARNING: multiple messages have this Message-ID (diff)
From: "Brian Dolbec" <brian.dolbec@gmail.com> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/sync/, pym/portage/sync/ Date: Thu, 4 Dec 2014 20:16:10 +0000 (UTC) [thread overview] Message-ID: <1417722994.b996dd99378c0e80c23361ec5d4eacee0bb936e6.dol-sen@gentoo> (raw) Message-ID: <20141204201610.krVvhjIIjMWNXzucBVg3w0oVAEaPtUM32EJhPPUn5JA@z> (raw) commit: b996dd99378c0e80c23361ec5d4eacee0bb936e6 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Fri Sep 5 20:08:36 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=b996dd99 portage/sync/controller.sync(): Migrate writemsg() call to return the error message to caller Highlight the "ERROR" string portion usig bad(), remove 1 linefeed. This puts the error in the emaint sync message list. --- pym/portage/emaint/modules/sync/sync.py | 6 +++--- pym/portage/sync/controller.py | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/pym/portage/emaint/modules/sync/sync.py b/pym/portage/emaint/modules/sync/sync.py index 86d16a3..c2847ae 100644 --- a/pym/portage/emaint/modules/sync/sync.py +++ b/pym/portage/emaint/modules/sync/sync.py @@ -179,11 +179,11 @@ class SyncRepos(object): sync_manager = get_syncer(self.emerge_config.target_config.settings, emergelog) retvals = [] for repo in selected_repos: - #print("syncing repo:", repo.name) if repo.sync_type is not None: - returncode = sync_manager.sync(self.emerge_config, repo) - #if returncode != os.EX_OK: + returncode, message = sync_manager.sync(self.emerge_config, repo) retvals.append((repo.name, returncode)) + if message: + msgs.append(message) # Reload the whole config. portage._sync_mode = False diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py index ddf48c8..10ae0a8 100644 --- a/pym/portage/sync/controller.py +++ b/pym/portage/sync/controller.py @@ -103,14 +103,13 @@ class SyncManager(object): if repo.sync_type in self.module_names[1:]: tasks = [self.module_controller.get_class(repo.sync_type)] else: - portage.util.writemsg( - "\nERROR: Sync module '%s' is not an installed/known type'\n\n" - % (repo.sync_type), noiselevel=-1) - return self.exitcode + msg = "\n%s: Sync module '%s' is not an installed/known type'\n" \ + % (bad("ERROR"), repo.sync_type) + return self.exitcode, msg rval = self.pre_sync(repo) if rval != os.EX_OK: - return rval + return rval, None # need to pass the kwargs dict to the modules # so they are available if needed. @@ -131,7 +130,7 @@ class SyncManager(object): self.perform_post_sync_hook(repo.sync_uri) - return self.exitcode + return self.exitcode, None def do_callback(self, result): @@ -168,7 +167,7 @@ class SyncManager(object): except OSError: st = None if st is None: - print(">>> '%s' not found, creating it." % repo.location) + writemsg_level(">>> '%s' not found, creating it." % repo.location) portage.util.ensure_dirs(repo.location, mode=0o755) st = os.stat(repo.location)
next reply other threads:[~2014-12-04 20:04 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-04 20:04 Brian Dolbec [this message] 2014-12-04 20:16 ` [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/sync/, pym/portage/sync/ Brian Dolbec -- strict thread matches above, loose matches on Subject: below -- 2014-10-21 19:37 [gentoo-commits] proj/portage:plugin-sync " Zac Medico 2014-10-21 5:05 Zac Medico 2014-10-21 4:11 Zac Medico 2014-10-20 3:54 Zac Medico 2014-09-29 18:29 Brian Dolbec
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1417722994.b996dd99378c0e80c23361ec5d4eacee0bb936e6.dol-sen@gentoo \ --to=brian.dolbec@gmail.com \ --cc=gentoo-commits@lists.gentoo.org \ --cc=gentoo-dev@lists.gentoo.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox