Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] repoman: Make the output qiuet when options.quiet=True (bug 576958)
Date: Thu, 10 Mar 2016 16:31:07
Message-Id: 20160310083007.23f7ee47.dolsen@gentoo.org
1 From e13e87a38f404a95ec7705f9fd8920201b632f42 Mon Sep 17 00:00:00 2001
2 From: Brian Dolbec <dolsen@g.o>
3 Date: Thu, 10 Mar 2016 08:11:51 -0800
4 Subject: [PATCH] repoman: Make the output qiuet when options.quiet=True (bug 576958)
5
6 In some cases do not output anything.
7 In some cases, output a simplified error message
8 X-Gentoo-bug: 576958
9 X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=576958
10 ---
11 pym/repoman/actions.py | 29 ++++++++++++++++++++---------
12 pym/repoman/scanner.py | 2 +-
13 2 files changed, 21 insertions(+), 10 deletions(-)
14
15 diff --git a/pym/repoman/actions.py b/pym/repoman/actions.py
16 index f461703..4f3f195 100644
17 --- a/pym/repoman/actions.py
18 +++ b/pym/repoman/actions.py
19 @@ -57,7 +57,8 @@ class Actions(object):
20
21 def inform(self, can_force, result):
22 '''Inform the user of all the problems found'''
23 - if self.suggest['ignore_masked'] or self.suggest['include_dev']:
24 + if ((self.suggest['ignore_masked'] or self.suggest['include_dev'])
25 + and not self.options.quiet):
26 self._suggest()
27 if self.options.mode != 'commit':
28 self._non_commit(result)
29 @@ -199,6 +200,8 @@ class Actions(object):
30
31 self.add_manifest(mymanifests, myheaders, myupdates, myremoved, commitmessage)
32
33 + if self.options.quiet:
34 + return
35 print()
36 if self.vcs_settings.vcs:
37 print("Commit complete.")
38 @@ -230,17 +233,25 @@ class Actions(object):
39 if result['full']:
40 print(bold("Note: type \"repoman full\" for a complete listing."))
41 if result['warn'] and not result['fail']:
42 - utilities.repoman_sez(
43 - "\"You're only giving me a partial QA payment?\n"
44 - " I'll take it this time, but I'm not happy.\"")
45 + if self.options.quiet:
46 + print(bold("Non-Fatal QA errors found"))
47 + else:
48 + utilities.repoman_sez(
49 + "\"You're only giving me a partial QA payment?\n"
50 + " I'll take it this time, but I'm not happy.\""
51 + )
52 elif not result['fail']:
53 - utilities.repoman_sez(
54 - "\"If everyone were like you, I'd be out of business!\"")
55 + if self.options.quiet:
56 + print("No QA issues found")
57 + else:
58 + utilities.repoman_sez(
59 + "\"If everyone were like you, I'd be out of business!\"")
60 elif result['fail']:
61 print(bad("Please fix these important QA issues first."))
62 - utilities.repoman_sez(
63 - "\"Make your QA payment on time"
64 - " and you'll never see the likes of me.\"\n")
65 + if not self.options.quiet:
66 + utilities.repoman_sez(
67 + "\"Make your QA payment on time"
68 + " and you'll never see the likes of me.\"\n")
69 sys.exit(1)
70
71
72 diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
73 index 84dbdf2..36248cb 100644
74 --- a/pym/repoman/scanner.py
75 +++ b/pym/repoman/scanner.py
76 @@ -163,7 +163,7 @@ class Scanner(object):
77 self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn')
78 self.check['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn
79
80 - if self.options.mode == "manifest":
81 + if self.options.mode == "manifest" or self.options.quiet:
82 pass
83 elif self.options.pretend:
84 print(green("\nRepoMan does a once-over of the neighborhood..."))
85 --
86 2.7.2

Replies