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 57B2013838B for ; Wed, 1 Oct 2014 23:46:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 58998E08B0; Wed, 1 Oct 2014 23:46:40 +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 87C23E08AE for ; Wed, 1 Oct 2014 23:46:39 +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 6F67F340374 for ; Wed, 1 Oct 2014 23:46:38 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FF9F6B81 for ; Wed, 1 Oct 2014 23:46:35 +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: <1412207133.e035de500b80f4304df4b0dd669203035c7ae019.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/main.py pym/repoman/utilities.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: e035de500b80f4304df4b0dd669203035c7ae019 X-VCS-Branch: repoman Date: Wed, 1 Oct 2014 23:46:35 +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: 7bd9ca97-aaeb-4304-a17f-85e58f23c322 X-Archives-Hash: 4c82e7e56fb8937001a6646ac2e9f54b commit: e035de500b80f4304df4b0dd669203035c7ae019 Author: Tom Wijsman gentoo org> AuthorDate: Tue Jun 3 11:28:44 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Oct 1 23:45:33 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e035de50 repoman/main.py: Refactor "RepoMan Sez" --- pym/repoman/main.py | 27 ++++++++++----------------- pym/repoman/utilities.py | 8 ++++++-- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/pym/repoman/main.py b/pym/repoman/main.py index 5f21e7a..3b5296b 100755 --- a/pym/repoman/main.py +++ b/pym/repoman/main.py @@ -973,25 +973,21 @@ if options.mode != 'commit': if dofull: print(bold("Note: type \"repoman full\" for a complete listing.")) if dowarn and not dofail: - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"You're only giving me a partial QA payment?\n" " I'll take it this time, but I'm not happy.\"") elif not dofail: - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"If everyone were like you, I'd be out of business!\"") elif dofail: print(bad("Please fix these important QA issues first.")) - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"Make your QA payment on time" " and you'll never see the likes of me.\"\n") sys.exit(1) else: if dofail and can_force and options.force and not options.pretend: - print( - green("RepoMan sez:"), + utilities.repoman_sez( " \"You want to commit even with these QA issues?\n" " I'll take it this time, but I'm not happy.\"\n") elif dofail: @@ -1000,15 +996,13 @@ else: "The --force option has been disabled" " due to extraordinary issues.")) print(bad("Please fix these important QA issues first.")) - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"Make your QA payment on time" " and you'll never see the likes of me.\"\n") sys.exit(1) if options.pretend: - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"So, you want to play it safe. Good call.\"\n") myunadded = [] @@ -1187,7 +1181,8 @@ else: if vcs_settings.vcs: if not (mychanged or mynew or myremoved or (vcs_settings.vcs == "hg" and mydeleted)): - print(green("RepoMan sez:"), "\"Doing nothing is not always good for QA.\"") + utilities.repoman_sez( + "\"Doing nothing is not always good for QA.\"") print() print("(Didn't find any changed files...)") print() @@ -1588,8 +1583,7 @@ else: portage.util.write_atomic(x, b''.join(mylines), mode='wb') if repolevel == 1: - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"You're rather crazy... " "doing the entire repository.\"\n") @@ -1706,7 +1700,6 @@ else: "repoman was too scared" " by not seeing any familiar version control file" " that he forgot to commit anything") - print( - green("RepoMan sez:"), + utilities.repoman_sez( "\"If everyone were like you, I'd be out of business!\"\n") sys.exit(0) diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index b7b3945..b19d4e1 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -39,9 +39,10 @@ from portage import shutil from portage import _encodings from portage import _unicode_decode from portage import _unicode_encode +from portage import util from portage.localization import _ from portage.process import find_binary -from portage import util +from portage.output import green from repoman.copyrights import update_copyright, update_copyright_year @@ -126,7 +127,6 @@ def FindPackagesToScan(settings, startdir, reposplit): path = os.path.join(startdir, cat) if not os.path.isdir(path): continue - pkgdirs = os.listdir(path) scanlist.extend(AddPackagesInDir(path)) elif repolevel == 2: # category level, startdir = catdir # We only want 1 segment of the directory, @@ -586,3 +586,7 @@ def UpdateChangeLog( except OSError: pass return None + + +def repoman_sez(msg): + print (green("RepoMan sez:"), msg)