commit: 50375654bfd565e9ea143d379f711e3a6c2eb167 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Thu Mar 10 16:11:51 2016 +0000 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> CommitDate: Thu Mar 10 20:58:15 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=50375654
repoman: Make the output quiet when options.quiet=True (bug 576958) In some cases do not output anything. In some cases, output a simplified error message X-Gentoo-bug: 576958 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576958 pym/repoman/actions.py | 29 ++++++++++++++++++++--------- pym/repoman/scanner.py | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py index f461703..4f3f195 100644 --- a/pym/repoman/actions.py +++ b/pym/repoman/actions.py @@ -57,7 +57,8 @@ class Actions(object): def inform(self, can_force, result): '''Inform the user of all the problems found''' - if self.suggest['ignore_masked'] or self.suggest['include_dev']: + if ((self.suggest['ignore_masked'] or self.suggest['include_dev']) + and not self.options.quiet): self._suggest() if self.options.mode != 'commit': self._non_commit(result) @@ -199,6 +200,8 @@ class Actions(object): self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage) + if self.options.quiet: + return print() if self.vcs_settings.vcs: print("Commit complete.") @@ -230,17 +233,25 @@ class Actions(object): if result['full']: print(bold("Note: type \"repoman full\" for a complete listing.")) if result['warn'] and not result['fail']: - utilities.repoman_sez( - "\"You're only giving me a partial QA payment?\n" - " I'll take it this time, but I'm not happy.\"") + if self.options.quiet: + print(bold("Non-Fatal QA errors found")) + else: + 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 result['fail']: - utilities.repoman_sez( - "\"If everyone were like you, I'd be out of business!\"") + if self.options.quiet: + print("No QA issues found") + else: + utilities.repoman_sez( + "\"If everyone were like you, I'd be out of business!\"") elif result['fail']: print(bad("Please fix these important QA issues first.")) - utilities.repoman_sez( - "\"Make your QA payment on time" - " and you'll never see the likes of me.\"\n") + if not self.options.quiet: + utilities.repoman_sez( + "\"Make your QA payment on time" + " and you'll never see the likes of me.\"\n") sys.exit(1) diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py index 84dbdf2..36248cb 100644 --- a/pym/repoman/scanner.py +++ b/pym/repoman/scanner.py @@ -163,7 +163,7 @@ class Scanner(object): self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn') self.check['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn - if self.options.mode == "manifest": + if self.options.mode == "manifest" or self.options.quiet: pass elif self.options.pretend: print(green("\nRepoMan does a once-over of the neighborhood..."))
