From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0CD8E1389E2 for ; Thu, 4 Dec 2014 20:04:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7AA33E08D0; Thu, 4 Dec 2014 20:04:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C0A11E087A for ; Thu, 4 Dec 2014 20:04:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0C447340581 for ; Thu, 4 Dec 2014 20:04:34 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0AF39B93C for ; Thu, 4 Dec 2014 20:04:31 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1417722994.b996dd99378c0e80c23361ec5d4eacee0bb936e6.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/emaint/modules/sync/, pym/portage/sync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/emaint/modules/sync/sync.py pym/portage/sync/controller.py X-VCS-Directories: pym/portage/sync/ pym/portage/emaint/modules/sync/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b996dd99378c0e80c23361ec5d4eacee0bb936e6 X-VCS-Branch: plugin-sync Date: Thu, 4 Dec 2014 20:04:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 61f478b0-2d95-482d-abca-6086f2515fbe X-Archives-Hash: a9ff5fb0b00e8997297fef3273ca8ac0 commit: b996dd99378c0e80c23361ec5d4eacee0bb936e6 Author: Brian Dolbec gentoo org> AuthorDate: Fri Sep 5 20:08:36 2014 +0000 Commit: Brian Dolbec gmail 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) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id D35BE1389E2 for ; Thu, 4 Dec 2014 20:16:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B45D0E090B; Thu, 4 Dec 2014 20:16:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DB1E7E08EC for ; Thu, 4 Dec 2014 20:16:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2676A340596 for ; Thu, 4 Dec 2014 20:16:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6AEE9B93F for ; Thu, 4 Dec 2014 20:16:10 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1417722994.b996dd99378c0e80c23361ec5d4eacee0bb936e6.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/emaint/modules/sync/, pym/portage/sync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/emaint/modules/sync/sync.py pym/portage/sync/controller.py X-VCS-Directories: pym/portage/emaint/modules/sync/ pym/portage/sync/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: b996dd99378c0e80c23361ec5d4eacee0bb936e6 X-VCS-Branch: master Date: Thu, 4 Dec 2014 20:16:10 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3419b60c-03f2-4ee9-bc7d-ab9400a679cc X-Archives-Hash: 979e3a9f1ad390092527ce64dac22794 Message-ID: <20141204201610.krVvhjIIjMWNXzucBVg3w0oVAEaPtUM32EJhPPUn5JA@z> commit: b996dd99378c0e80c23361ec5d4eacee0bb936e6 Author: Brian Dolbec gentoo org> AuthorDate: Fri Sep 5 20:08:36 2014 +0000 Commit: Brian Dolbec gmail 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)