Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12050 - in main/branches/2.1.6: bin man pym/repoman
Date: Sun, 23 Nov 2008 05:50:35
Message-Id: E1L47rc-0003XO-TH@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-11-23 05:50:32 +0000 (Sun, 23 Nov 2008)
3 New Revision: 12050
4
5 Modified:
6 main/branches/2.1.6/bin/repoman
7 main/branches/2.1.6/man/repoman.1
8 main/branches/2.1.6/pym/repoman/utilities.py
9 Log:
10 Bug #247548 - Remove 'last' and 'lfull' commands since nobody uses them.
11 Thanks to Alec Warner <antarus@g.o>. (trunk r12049)
12
13
14 Modified: main/branches/2.1.6/bin/repoman
15 ===================================================================
16 --- main/branches/2.1.6/bin/repoman 2008-11-23 05:47:57 UTC (rev 12049)
17 +++ main/branches/2.1.6/bin/repoman 2008-11-23 05:50:32 UTC (rev 12050)
18 @@ -26,11 +26,6 @@
19 from stat import S_ISDIR, ST_CTIME
20
21 try:
22 - import cPickle as pickle
23 -except ImportError:
24 - import pickle
25 -
26 -try:
27 import cStringIO as StringIO
28 except ImportError:
29 import StringIO
30 @@ -151,8 +146,6 @@
31 'fix' : 'Fix simple QA issues (stray digests, missing digests)',
32 'full' : 'Scan directory tree and print all issues (not a summary)',
33 'help' : 'Show this screen',
34 - 'last' : 'Remember report from last run',
35 - 'lfull' : 'Remember report from last run (full listing)',
36 'manifest' : 'Generate a Manifest (fetches files if necessary)',
37 'scan' : 'Scan directory tree for QA issues'
38 }
39 @@ -228,7 +221,7 @@
40 break
41
42 if not opts.mode:
43 - opts.mode = 'full' #default to full
44 + opts.mode = 'full'
45
46 if opts.mode == 'ci':
47 opts.mode = 'commit' # backwards compat shortcut
48 @@ -424,61 +417,8 @@
49 # file.executable
50 no_exec = frozenset(["Manifest","ChangeLog","metadata.xml"])
51
52 -def last(full=False):
53 - """Print the results of the last repoman run
54 - Args:
55 - full - Print the complete results, if false, print a summary
56 - Returns:
57 - Doesn't return (invokes sys.exit()
58 - """
59 - #Retrieve and unpickle stats and fails from saved files
60 - savedf=open(os.path.join(portage.const.CACHE_PATH, 'repo.stats'),'r')
61 - stats = pickle.load(savedf)
62 - savedf.close()
63 - savedf=open(os.path.join(portage.const.CACHE_PATH, 'repo.fails'),'r')
64 - fails = pickle.load(savedf)
65 - savedf.close()
66 -
67 - #dofail will be set to 1 if we have failed in at least one non-warning category
68 - dofail=0
69 - #dowarn will be set to 1 if we tripped any warnings
70 - dowarn=0
71 - #dofull will be set if we should print a "repoman full" informational message
72 - dofull=0
73 -
74 - dofull = options.mode not in ("full", "lfull")
75 -
76 - for x in qacats:
77 - if not stats[x]:
78 - continue
79 - dowarn = 1
80 - if x not in qawarnings:
81 - dofail = 1
82 -
83 - print
84 - print green("RepoMan remembers...")
85 - print
86 - style_file = ConsoleStyleFile(sys.stdout)
87 - console_writer = StyleWriter(file=style_file, maxcol=9999)
88 - console_writer.style_listener = style_file.new_styles
89 - f = formatter.AbstractFormatter(console_writer)
90 - utilities.format_qa_output(f, stats, fails, dofull, dofail, options, qawarnings)
91 - print
92 - if dofull:
93 - print bold("Note: type \"repoman lfull\" for a complete listing of repomans last run.")
94 - print
95 - if dowarn and not dofail:
96 - print green("RepoMan sez:"),"\"You only gave me a partial QA payment last time?\n I took it, but I wasn't happy.\""
97 - elif not dofail:
98 - print green("RepoMan sez:"),"\"If everyone were like you, I'd be out of business!\""
99 - print
100 - sys.exit(0)
101 -
102 options, arguments = ParseArgs(sys.argv, qahelp)
103
104 -if options.mode in ('last', 'lfull'):
105 - last('lfull' in options.mode)
106 -
107 # Set this to False when an extraordinary issue (generally
108 # something other than a QA issue) makes it impossible to
109 # commit (like if Manifest generation fails).
110 @@ -1608,24 +1548,12 @@
111 if options.mode == "manifest":
112 sys.exit(dofail)
113
114 -#Pickle and save results for instant reuse in last and lfull
115 -if os.access(portage.const.CACHE_PATH, os.W_OK):
116 - for myobj, fname in (stats, "repo.stats"), (fails, "repo.fails"):
117 - fpath = os.path.join(portage.const.CACHE_PATH, fname)
118 - savef = open(fpath, 'w')
119 - pickle.dump(myobj, savef)
120 - savef.close()
121 - portage.apply_secpass_permissions(fpath, gid=portage.portage_gid,
122 - mode=0664)
123 -
124 -# TODO(antarus) This function and last () look familiar ;)
125 -
126 #dofail will be set to 1 if we have failed in at least one non-warning category
127 dofail=0
128 #dowarn will be set to 1 if we tripped any warnings
129 dowarn=0
130 #dofull will be set if we should print a "repoman full" informational message
131 -dofull = options.mode not in ("full", "lfull")
132 +dofull = options.mode != 'full'
133
134 for x in qacats:
135 if not stats[x]:
136
137 Modified: main/branches/2.1.6/man/repoman.1
138 ===================================================================
139 --- main/branches/2.1.6/man/repoman.1 2008-11-23 05:47:57 UTC (rev 12049)
140 +++ main/branches/2.1.6/man/repoman.1 2008-11-23 05:50:32 UTC (rev 12050)
141 @@ -59,9 +59,6 @@
142 .B full
143 Scan directory tree for QA issues (full listing)
144 .TP
145 -.B last
146 -Remember report from last run
147 -.TP
148 .B help
149 Show this screen
150 .TP
151 @@ -71,9 +68,6 @@
152 .B fix
153 Fix simple QA issues (stray digests, missing digests)
154 .TP
155 -.B lfull
156 -Remember report from last run (full listing)
157 -.TP
158 .B manifest
159 Generate a Manifest (fetches files if necessary)
160 .TP
161
162 Modified: main/branches/2.1.6/pym/repoman/utilities.py
163 ===================================================================
164 --- main/branches/2.1.6/pym/repoman/utilities.py 2008-11-23 05:47:57 UTC (rev 12049)
165 +++ main/branches/2.1.6/pym/repoman/utilities.py 2008-11-23 05:50:32 UTC (rev 12050)
166 @@ -211,7 +211,7 @@
167 Returns:
168 None (modifies formatter)
169 """
170 - full = options.mode in ("full", "lfull")
171 + full = options.mode == 'full'
172 # we only want key value pairs where value > 0
173 for category, number in \
174 itertools.ifilter(lambda myitem: myitem[1] > 0, stats.iteritems()):