Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/
Date: Fri, 30 May 2014 13:03:36
Message-Id: 1401395564.b3f8adf37c195420511ebe3849ea0dffe14bd270.dol-sen@gentoo
1 commit: b3f8adf37c195420511ebe3849ea0dffe14bd270
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Thu May 29 20:32:44 2014 +0000
4 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
5 CommitDate: Thu May 29 20:32:44 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b3f8adf3
7
8 repoman/main.py: Rename x variable in loop to xpkg
9
10 This will help clarify what it is better.
11
12 ---
13 pym/repoman/main.py | 82 ++++++++++++++++++++++++++---------------------------
14 1 file changed, 41 insertions(+), 41 deletions(-)
15
16 diff --git a/pym/repoman/main.py b/pym/repoman/main.py
17 index 46cdefd..99238d9 100755
18 --- a/pym/repoman/main.py
19 +++ b/pym/repoman/main.py
20 @@ -321,14 +321,14 @@ if options.if_modified == "y":
21 effective_scanlist = sorted(vcs_files_to_cps(
22 chain(changed.changed, changed.new, changed.removed)))
23
24 -for x in effective_scanlist:
25 +for xpkg in effective_scanlist:
26 # ebuilds and digests added to cvs respectively.
27 - logging.info("checking package %s" % x)
28 + logging.info("checking package %s" % xpkg)
29 # save memory by discarding xmatch caches from previous package(s)
30 arch_xmatch_caches.clear()
31 eadded = []
32 - catdir, pkgdir = x.split("/")
33 - checkdir = repo_settings.repodir + "/" + x
34 + catdir, pkgdir = xpkg.split("/")
35 + checkdir = repo_settings.repodir + "/" + xpkg
36 checkdir_relative = ""
37 if repolevel < 3:
38 checkdir_relative = os.path.join(pkgdir, checkdir_relative)
39 @@ -348,7 +348,7 @@ for x in effective_scanlist:
40 repoman_settings['PORTAGE_QUIET'] = '1'
41 if not portage.digestcheck([], repoman_settings, strict=1):
42 stats["manifest.bad"] += 1
43 - fails["manifest.bad"].append(os.path.join(x, 'Manifest'))
44 + fails["manifest.bad"].append(os.path.join(xpkg, 'Manifest'))
45 repoman_settings.pop('PORTAGE_QUIET', None)
46
47 if options.mode == 'manifest-check':
48 @@ -378,17 +378,17 @@ for x in effective_scanlist:
49 except KeyError:
50 allvalid = False
51 stats["ebuild.syntax"] += 1
52 - fails["ebuild.syntax"].append(os.path.join(x, y))
53 + fails["ebuild.syntax"].append(os.path.join(xpkg, y))
54 continue
55 except IOError:
56 allvalid = False
57 stats["ebuild.output"] += 1
58 - fails["ebuild.output"].append(os.path.join(x, y))
59 + fails["ebuild.output"].append(os.path.join(xpkg, y))
60 continue
61 if not portage.eapi_is_supported(myaux["EAPI"]):
62 allvalid = False
63 stats["EAPI.unsupported"] += 1
64 - fails["EAPI.unsupported"].append(os.path.join(x, y))
65 + fails["EAPI.unsupported"].append(os.path.join(xpkg, y))
66 continue
67 pkgs[pf] = Package(
68 cpv=cpv, metadata=myaux, root_config=root_config,
69 @@ -462,7 +462,7 @@ for x in effective_scanlist:
70 if l[:-1][-7:] == ".ebuild":
71 stats["ebuild.notadded"] += 1
72 fails["ebuild.notadded"].append(
73 - os.path.join(x, os.path.basename(l[:-1])))
74 + os.path.join(xpkg, os.path.basename(l[:-1])))
75 myf.close()
76
77 if vcs_settings.vcs in ("cvs", "svn", "bzr") and check_ebuild_notadded:
78 @@ -570,7 +570,7 @@ for x in effective_scanlist:
79 # so people can't hide > 20k files in a subdirectory.
80 while filesdirlist:
81 y = filesdirlist.pop(0)
82 - relative_path = os.path.join(x, "files", y)
83 + relative_path = os.path.join(xpkg, "files", y)
84 full_path = os.path.join(repo_settings.repodir, relative_path)
85 try:
86 mystat = os.stat(full_path)
87 @@ -594,11 +594,11 @@ for x in effective_scanlist:
88 elif mystat.st_size > 61440:
89 stats["file.size.fatal"] += 1
90 fails["file.size.fatal"].append(
91 - "(%d KiB) %s/files/%s" % (mystat.st_size // 1024, x, y))
92 + "(%d KiB) %s/files/%s" % (mystat.st_size // 1024, xpkg, y))
93 elif mystat.st_size > 20480:
94 stats["file.size"] += 1
95 fails["file.size"].append(
96 - "(%d KiB) %s/files/%s" % (mystat.st_size // 1024, x, y))
97 + "(%d KiB) %s/files/%s" % (mystat.st_size // 1024, xpkg, y))
98
99 index = repo_settings.repo_config.find_invalid_path_char(y)
100 if index != -1:
101 @@ -617,13 +617,13 @@ for x in effective_scanlist:
102
103 if check_changelog and "ChangeLog" not in checkdirlist:
104 stats["changelog.missing"] += 1
105 - fails["changelog.missing"].append(x + "/ChangeLog")
106 + fails["changelog.missing"].append(xpkg + "/ChangeLog")
107
108 musedict = {}
109 # metadata.xml file check
110 if "metadata.xml" not in checkdirlist:
111 stats["metadata.missing"] += 1
112 - fails["metadata.missing"].append(x + "/metadata.xml")
113 + fails["metadata.missing"].append(xpkg + "/metadata.xml")
114 # metadata.xml parse check
115 else:
116 metadata_bad = False
117 @@ -640,7 +640,7 @@ for x in effective_scanlist:
118 except (ExpatError, SyntaxError, EnvironmentError) as e:
119 metadata_bad = True
120 stats["metadata.bad"] += 1
121 - fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
122 + fails["metadata.bad"].append("%s/metadata.xml: %s" % (xpkg, e))
123 del e
124 else:
125 if not hasattr(xml_parser, 'parser') or \
126 @@ -654,7 +654,7 @@ for x in effective_scanlist:
127 fails["metadata.bad"].append(
128 "%s/metadata.xml: "
129 "xml declaration is missing on first line, "
130 - "should be '%s'" % (x, metadata_xml_declaration))
131 + "should be '%s'" % (xpkg, metadata_xml_declaration))
132 else:
133 xml_version, xml_encoding, xml_standalone = \
134 xml_info["XML_DECLARATION"]
135 @@ -668,13 +668,13 @@ for x in effective_scanlist:
136 fails["metadata.bad"].append(
137 "%s/metadata.xml: "
138 "xml declaration encoding should be '%s', %s" %
139 - (x, metadata_xml_encoding, encoding_problem))
140 + (xpkg, metadata_xml_encoding, encoding_problem))
141
142 if "DOCTYPE" not in xml_info:
143 metadata_bad = True
144 stats["metadata.bad"] += 1
145 fails["metadata.bad"].append(
146 - "%s/metadata.xml: %s" % (x, "DOCTYPE is missing"))
147 + "%s/metadata.xml: %s" % (xpkg, "DOCTYPE is missing"))
148 else:
149 doctype_name, doctype_system, doctype_pubid = \
150 xml_info["DOCTYPE"]
151 @@ -687,14 +687,14 @@ for x in effective_scanlist:
152 fails["metadata.bad"].append(
153 "%s/metadata.xml: "
154 "DOCTYPE: SYSTEM should refer to '%s', %s" %
155 - (x, metadata_dtd_uri, system_problem))
156 + (xpkg, metadata_dtd_uri, system_problem))
157
158 if doctype_name != metadata_doctype_name:
159 stats["metadata.bad"] += 1
160 fails["metadata.bad"].append(
161 "%s/metadata.xml: "
162 "DOCTYPE: name should be '%s', not '%s'" %
163 - (x, metadata_doctype_name, doctype_name))
164 + (xpkg, metadata_doctype_name, doctype_name))
165
166 # load USE flags from metadata.xml
167 try:
168 @@ -702,7 +702,7 @@ for x in effective_scanlist:
169 except portage.exception.ParseError as e:
170 metadata_bad = True
171 stats["metadata.bad"] += 1
172 - fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
173 + fails["metadata.bad"].append("%s/metadata.xml: %s" % (xpkg, e))
174 else:
175 for atom in chain(*musedict.values()):
176 if atom is None:
177 @@ -712,13 +712,13 @@ for x in effective_scanlist:
178 except InvalidAtom as e:
179 stats["metadata.bad"] += 1
180 fails["metadata.bad"].append(
181 - "%s/metadata.xml: Invalid atom: %s" % (x, e))
182 + "%s/metadata.xml: Invalid atom: %s" % (xpkg, e))
183 else:
184 - if atom.cp != x:
185 + if atom.cp != xpkg:
186 stats["metadata.bad"] += 1
187 fails["metadata.bad"].append(
188 "%s/metadata.xml: Atom contains "
189 - "unexpected cat/pn: %s" % (x, atom))
190 + "unexpected cat/pn: %s" % (xpkg, atom))
191
192 # Run other metadata.xml checkers
193 try:
194 @@ -726,7 +726,7 @@ for x in effective_scanlist:
195 except (utilities.UnknownHerdsError, ) as e:
196 metadata_bad = True
197 stats["metadata.bad"] += 1
198 - fails["metadata.bad"].append("%s/metadata.xml: %s" % (x, e))
199 + fails["metadata.bad"].append("%s/metadata.xml: %s" % (xpkg, e))
200 del e
201
202 #################
203 @@ -734,7 +734,7 @@ for x in effective_scanlist:
204 if not metadata_bad:
205 if not xmllint.check(checkdir):
206 stats["metadata.bad"] += 1
207 - fails["metadata.bad"].append(x + "/metadata.xml")
208 + fails["metadata.bad"].append(xpkg + "/metadata.xml")
209
210 #################
211 del metadata_bad
212 @@ -748,7 +748,7 @@ for x in effective_scanlist:
213
214 for y in ebuildlist:
215 ##################
216 - ebuild = Ebuild(repo_settings, repolevel, pkgdir, catdir, vcs_settings, x, y)
217 + ebuild = Ebuild(repo_settings, repolevel, pkgdir, catdir, vcs_settings, xpkg, y)
218 ##################
219
220 if check_changelog and not changelog_modified \
221 @@ -759,10 +759,10 @@ for x in effective_scanlist:
222 if ebuild.untracked(check_ebuild_notadded, y, eadded):
223 # ebuild not added to vcs
224 stats["ebuild.notadded"] += 1
225 - fails["ebuild.notadded"].append(x + "/" + y + ".ebuild")
226 + fails["ebuild.notadded"].append(xpkg + "/" + y + ".ebuild")
227 myesplit = portage.pkgsplit(y)
228
229 - is_bad_split = myesplit is None or myesplit[0] != x.split("/")[-1]
230 + is_bad_split = myesplit is None or myesplit[0] != xpkg.split("/")[-1]
231
232 if is_bad_split:
233 is_pv_toolong = pv_toolong_re.search(myesplit[1])
234 @@ -770,12 +770,12 @@ for x in effective_scanlist:
235
236 if is_pv_toolong or is_pv_toolong2:
237 stats["ebuild.invalidname"] += 1
238 - fails["ebuild.invalidname"].append(x + "/" + y + ".ebuild")
239 + fails["ebuild.invalidname"].append(xpkg + "/" + y + ".ebuild")
240 continue
241 elif myesplit[0] != pkgdir:
242 print(pkgdir, myesplit[0])
243 stats["ebuild.namenomatch"] += 1
244 - fails["ebuild.namenomatch"].append(x + "/" + y + ".ebuild")
245 + fails["ebuild.namenomatch"].append(xpkg + "/" + y + ".ebuild")
246 continue
247
248 pkg = pkgs[y]
249 @@ -834,7 +834,7 @@ for x in effective_scanlist:
250 continue
251 myqakey = missingvars[pos] + ".missing"
252 stats[myqakey] += 1
253 - fails[myqakey].append(x + "/" + y + ".ebuild")
254 + fails[myqakey].append(xpkg + "/" + y + ".ebuild")
255
256 if catdir == "virtual":
257 for var in ("HOMEPAGE", "LICENSE"):
258 @@ -868,7 +868,7 @@ for x in effective_scanlist:
259 stats["KEYWORDS.stable"] += 1
260 fails["KEYWORDS.stable"].append(
261 "%s/%s.ebuild added with stable keywords: %s" %
262 - (x, y, " ".join(stable_keywords)))
263 + (xpkg, y, " ".join(stable_keywords)))
264
265 ebuild_archs = set(
266 kw.lstrip("~") for kw in keywords if not kw.startswith("-"))
267 @@ -897,7 +897,7 @@ for x in effective_scanlist:
268 haskeyword = True
269 if not haskeyword:
270 stats["KEYWORDS.stupid"] += 1
271 - fails["KEYWORDS.stupid"].append(x + "/" + y + ".ebuild")
272 + fails["KEYWORDS.stupid"].append(xpkg + "/" + y + ".ebuild")
273
274 """
275 Ebuilds that inherit a "Live" eclass (darcs,subversion,git,cvs,etc..) should
276 @@ -914,7 +914,7 @@ for x in effective_scanlist:
277 stats["LIVEVCS.stable"] += 1
278 fails["LIVEVCS.stable"].append(
279 "%s/%s.ebuild with stable keywords:%s " %
280 - (x, y, bad_stable_keywords))
281 + (xpkg, y, bad_stable_keywords))
282 del bad_stable_keywords
283
284 if keywords and not has_global_mask(pkg):
285 @@ -1086,7 +1086,7 @@ for x in effective_scanlist:
286
287 for mypos in range(len(myuse)):
288 stats["IUSE.invalid"] += 1
289 - fails["IUSE.invalid"].append(x + "/" + y + ".ebuild: %s" % myuse[mypos])
290 + fails["IUSE.invalid"].append(xpkg + "/" + y + ".ebuild: %s" % myuse[mypos])
291
292 # Check for outdated RUBY targets
293 old_ruby_eclasses = ["ruby-ng", "ruby-fakegem", "ruby"]
294 @@ -1112,7 +1112,7 @@ for x in effective_scanlist:
295 # function will remove it without removing values.
296 if lic not in liclist and lic != "||":
297 stats["LICENSE.invalid"] += 1
298 - fails["LICENSE.invalid"].append(x + "/" + y + ".ebuild: %s" % lic)
299 + fails["LICENSE.invalid"].append(xpkg + "/" + y + ".ebuild: %s" % lic)
300 elif lic in liclist_deprecated:
301 stats["LICENSE.deprecated"] += 1
302 fails["LICENSE.deprecated"].append("%s: %s" % (ebuild.relative_path, lic))
303 @@ -1129,11 +1129,11 @@ for x in effective_scanlist:
304 if myskey not in kwlist:
305 stats["KEYWORDS.invalid"] += 1
306 fails["KEYWORDS.invalid"].append(
307 - "%s/%s.ebuild: %s" % (x, y, mykey))
308 + "%s/%s.ebuild: %s" % (xpkg, y, mykey))
309 elif myskey not in profiles:
310 stats["KEYWORDS.invalid"] += 1
311 fails["KEYWORDS.invalid"].append(
312 - "%s/%s.ebuild: %s (profile invalid)" % (x, y, mykey))
313 + "%s/%s.ebuild: %s (profile invalid)" % (xpkg, y, mykey))
314
315 # restrict checks
316 myrestrict = None
317 @@ -1151,7 +1151,7 @@ for x in effective_scanlist:
318 if mybadrestrict:
319 stats["RESTRICT.invalid"] += len(mybadrestrict)
320 for mybad in mybadrestrict:
321 - fails["RESTRICT.invalid"].append(x + "/" + y + ".ebuild: %s" % mybad)
322 + fails["RESTRICT.invalid"].append(xpkg + "/" + y + ".ebuild: %s" % mybad)
323 # REQUIRED_USE check
324 required_use = myaux["REQUIRED_USE"]
325 if required_use:
326 @@ -1370,7 +1370,7 @@ for x in effective_scanlist:
327 stats["metadata.warning"] += 1
328 fails["metadata.warning"].append(
329 "%s/metadata.xml: unused local USE-description: '%s'" %
330 - (x, myflag))
331 + (xpkg, myflag))
332
333 if options.if_modified == "y" and len(effective_scanlist) < 1:
334 logging.warn("--if-modified is enabled, but no modified packages were found!")