1 |
Author: grobian |
2 |
Date: 2009-10-02 20:40:28 +0000 (Fri, 02 Oct 2009) |
3 |
New Revision: 14473 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/bin/egencache |
7 |
main/branches/prefix/bin/repoman |
8 |
main/branches/prefix/man/egencache.1 |
9 |
main/branches/prefix/man/repoman.1 |
10 |
main/branches/prefix/pym/_emerge/Package.py |
11 |
main/branches/prefix/pym/_emerge/depgraph.py |
12 |
main/branches/prefix/pym/portage/__init__.py |
13 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
14 |
main/branches/prefix/pym/portage/dep.py |
15 |
main/branches/prefix/pym/portage/versions.py |
16 |
main/branches/prefix/pym/repoman/checks.py |
17 |
Log: |
18 |
Merged from trunk -r14463:14472 |
19 |
|
20 |
| 14465 | Fix SyntaxError with Python 3 added in r14462. | |
21 |
| arfrever | | |
22 |
|
23 |
| 14466 | Take regular expressions from portage.dep and use them to | |
24 |
| zmedico | reimplement portage.versions.pkgsplit(). This simplifies | |
25 |
| | the code and helps guarantee consistency package | |
26 |
| | name/version validation. | |
27 |
|
28 |
| 14467 | Use a regular expression for SLOT validation inside | |
29 |
| zmedico | vardbapi.aux_get(). | |
30 |
|
31 |
| 14468 | Bug #286895 - Generate an eerror message when a directory | |
32 |
| zmedico | blocks merge of a regular file and the file is merged using | |
33 |
| | a 'config protect' filename even though the path may not be | |
34 |
| | among those covered by CONFIG_PROTECT. | |
35 |
|
36 |
| 14469 | Add --tolerant option (already in use on master rsync | |
37 |
| zmedico | mirror), requested by robbat2. | |
38 |
|
39 |
| 14470 | Remove libtool from RDEPEND.suspect list, since libltdl.so | |
40 |
| zmedico | is validly used by some packages at runtime. Thanks to | |
41 |
| | Samuli Suominen <ssuominen@g.o> for reporting. | |
42 |
|
43 |
| 14471 | Bug #285191 - Remove the RDEPEND.implicit check because it | |
44 |
| zmedico | is invalid. | |
45 |
|
46 |
| 14472 | Bug #287333 - Fix the code from bug #252167 so it behaves | |
47 |
| zmedico | consistently regardless of the package (ebuild or binpkg) | |
48 |
| | being masked. | |
49 |
|
50 |
|
51 |
Modified: main/branches/prefix/bin/egencache |
52 |
=================================================================== |
53 |
--- main/branches/prefix/bin/egencache 2009-10-02 19:24:44 UTC (rev 14472) |
54 |
+++ main/branches/prefix/bin/egencache 2009-10-02 20:40:28 UTC (rev 14473) |
55 |
@@ -67,6 +67,9 @@ |
56 |
action="store_true", |
57 |
help="enable rsync stat collision workaround " + \ |
58 |
"for bug 139134 (use with --update)") |
59 |
+ parser.add_option("--tolerant", |
60 |
+ action="store_true", |
61 |
+ help="exit successfully if only minor errors occurred") |
62 |
parser.add_option("--ignore-default-opts", |
63 |
action="store_true", |
64 |
help="do not use the EGENCACHE_DEFAULT_OPTS environment variable") |
65 |
@@ -343,6 +346,8 @@ |
66 |
max_load=options.load_average, |
67 |
rsync=options.rsync) |
68 |
gen_cache.run() |
69 |
+ if options.tolerant: |
70 |
+ return os.EX_OK |
71 |
return gen_cache.returncode |
72 |
|
73 |
if __name__ == "__main__": |
74 |
|
75 |
Modified: main/branches/prefix/bin/repoman |
76 |
=================================================================== |
77 |
--- main/branches/prefix/bin/repoman 2009-10-02 19:24:44 UTC (rev 14472) |
78 |
+++ main/branches/prefix/bin/repoman 2009-10-02 20:40:28 UTC (rev 14473) |
79 |
@@ -426,7 +426,6 @@ |
80 |
"sys-devel/bison", |
81 |
"sys-devel/dev86", |
82 |
"sys-devel/flex", |
83 |
- "sys-devel/libtool", |
84 |
"sys-devel/m4", |
85 |
"sys-devel/pmake", |
86 |
"x11-misc/bdftopcf", |
87 |
|
88 |
Modified: main/branches/prefix/man/egencache.1 |
89 |
=================================================================== |
90 |
--- main/branches/prefix/man/egencache.1 2009-10-02 19:24:44 UTC (rev 14472) |
91 |
+++ main/branches/prefix/man/egencache.1 2009-10-02 20:40:28 UTC (rev 14473) |
92 |
@@ -54,6 +54,11 @@ |
93 |
(see \fBbug 139134\fR). It's not needed with \fBgit\fR(1) since that uses a |
94 |
more thorough mechanism which allows it to detect changed inode numbers |
95 |
(described in \fIracy-git.txt\fR in the git technical docs). |
96 |
+.TP |
97 |
+.BR "\-\-tolerant" |
98 |
+Exit successfully if only minor errors occurred, such as skipped cache |
99 |
+updates due to ebuilds that either fail to source or are not sourced |
100 |
+due to invalid Manifest entries. |
101 |
.SH "ENVIRONMENT OPTIONS" |
102 |
.TP |
103 |
\fBEGENCACHE_DEFAULT_OPTS\fR |
104 |
|
105 |
Modified: main/branches/prefix/man/repoman.1 |
106 |
=================================================================== |
107 |
--- main/branches/prefix/man/repoman.1 2009-10-02 19:24:44 UTC (rev 14472) |
108 |
+++ main/branches/prefix/man/repoman.1 2009-10-02 20:40:28 UTC (rev 14473) |
109 |
@@ -186,10 +186,6 @@ |
110 |
.B RDEPEND.badmaskedindev |
111 |
Masked ebuilds with RDEPEND settings (matched against *all* ebuilds) in developing arch |
112 |
.TP |
113 |
-.B RDEPEND.implicit |
114 |
-RDEPEND is unset in the ebuild which triggers implicit RDEPEND=$DEPEND |
115 |
-assignment |
116 |
-.TP |
117 |
.B RDEPEND.suspect |
118 |
RDEPEND contains a package that usually only belongs in DEPEND |
119 |
.TP |
120 |
|
121 |
Modified: main/branches/prefix/pym/_emerge/Package.py |
122 |
=================================================================== |
123 |
--- main/branches/prefix/pym/_emerge/Package.py 2009-10-02 19:24:44 UTC (rev 14472) |
124 |
+++ main/branches/prefix/pym/_emerge/Package.py 2009-10-02 20:40:28 UTC (rev 14473) |
125 |
@@ -212,7 +212,7 @@ |
126 |
elif k in self._use_conditional_keys: |
127 |
try: |
128 |
use_reduce(paren_reduce(v), matchall=1) |
129 |
- except portage.exception.InvalidDependString, e: |
130 |
+ except portage.exception.InvalidDependString as e: |
131 |
self._pkg._invalid_metadata(k + ".syntax", "%s: %s" % (k, e)) |
132 |
|
133 |
def _set_inherited(self, k, v): |
134 |
|
135 |
Modified: main/branches/prefix/pym/_emerge/depgraph.py |
136 |
=================================================================== |
137 |
--- main/branches/prefix/pym/_emerge/depgraph.py 2009-10-02 19:24:44 UTC (rev 14472) |
138 |
+++ main/branches/prefix/pym/_emerge/depgraph.py 2009-10-02 20:40:28 UTC (rev 14473) |
139 |
@@ -2304,8 +2304,7 @@ |
140 |
reinstall_for_flags = None |
141 |
|
142 |
if not pkg.installed or \ |
143 |
- (pkg.built and matched_packages and \ |
144 |
- not (avoid_update and pkg.installed)): |
145 |
+ (matched_packages and not avoid_update): |
146 |
# Only enforce visibility on installed packages |
147 |
# if there is at least one other visible package |
148 |
# available. By filtering installed masked packages |
149 |
@@ -2323,8 +2322,8 @@ |
150 |
# with visible KEYWORDS when the installed |
151 |
# version is masked by KEYWORDS, but never |
152 |
# reinstall the same exact version only due |
153 |
- # to a KEYWORDS mask. |
154 |
- if built and matched_packages: |
155 |
+ # to a KEYWORDS mask. See bug #252167. |
156 |
+ if matched_packages: |
157 |
|
158 |
different_version = None |
159 |
for avail_pkg in matched_packages: |
160 |
|
161 |
Modified: main/branches/prefix/pym/portage/__init__.py |
162 |
=================================================================== |
163 |
--- main/branches/prefix/pym/portage/__init__.py 2009-10-02 19:24:44 UTC (rev 14472) |
164 |
+++ main/branches/prefix/pym/portage/__init__.py 2009-10-02 20:40:28 UTC (rev 14473) |
165 |
@@ -8183,7 +8183,7 @@ |
166 |
return None |
167 |
return deplist |
168 |
|
169 |
-_cpv_key_re = re.compile('^' + dep._cpv + '$', re.VERBOSE) |
170 |
+_cpv_key_re = re.compile('^' + versions._cpv + '$', re.VERBOSE) |
171 |
def cpv_getkey(mycpv): |
172 |
"""Calls pkgsplit on a cpv and returns only the cp.""" |
173 |
m = _cpv_key_re.match(mycpv) |
174 |
|
175 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
176 |
=================================================================== |
177 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2009-10-02 19:24:44 UTC (rev 14472) |
178 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2009-10-02 20:40:28 UTC (rev 14473) |
179 |
@@ -13,7 +13,7 @@ |
180 |
portage.proxy.lazyimport.lazyimport(globals(), |
181 |
'portage.checksum:_perform_md5_merge@perform_md5', |
182 |
'portage.dep:dep_getkey,isjustname,match_from_list,' + \ |
183 |
- 'use_reduce,paren_reduce', |
184 |
+ 'use_reduce,paren_reduce,_slot_re', |
185 |
'portage.elog:elog_process', |
186 |
'portage.elog.filtering:filter_mergephases,filter_unmergephases', |
187 |
'portage.locks:lockdir,unlockdir', |
188 |
@@ -1967,10 +1967,12 @@ |
189 |
cache_data[aux_key] = mydata[aux_key] |
190 |
self._aux_cache["packages"][mycpv] = (mydir_mtime, cache_data) |
191 |
self._aux_cache["modified"].add(mycpv) |
192 |
- if not mydata['SLOT']: |
193 |
- # Empty slot triggers InvalidAtom exceptions when generating slot |
194 |
- # atoms for packages, so translate it to '0' here. |
195 |
+ |
196 |
+ if _slot_re.match(mydata['SLOT']) is None: |
197 |
+ # Empty or invalid slot triggers InvalidAtom exceptions when |
198 |
+ # generating slot atoms for packages, so translate it to '0' here. |
199 |
mydata['SLOT'] = _unicode_decode('0') |
200 |
+ |
201 |
return [mydata[x] for x in wants] |
202 |
|
203 |
def _aux_get(self, mycpv, wants, st=None): |
204 |
@@ -4890,12 +4892,20 @@ |
205 |
protected = self.isprotected(mydest) |
206 |
if mydmode != None: |
207 |
# destination file exists |
208 |
- cfgprot = 0 |
209 |
+ |
210 |
if stat.S_ISDIR(mydmode): |
211 |
# install of destination is blocked by an existing directory with the same name |
212 |
- cfgprot = 1 |
213 |
- showMessage("!!! %s\n" % mydest, |
214 |
- level=logging.ERROR, noiselevel=-1) |
215 |
+ newdest = new_protect_filename(mydest, newmd5=mymd5) |
216 |
+ msg = [] |
217 |
+ msg.append("") |
218 |
+ msg.append("Installation of a regular file is blocked by a directory:") |
219 |
+ msg.append(" '%s'" % mydest) |
220 |
+ msg.append("This file will be merged with a different name:") |
221 |
+ msg.append(" '%s'" % newdest) |
222 |
+ msg.append("") |
223 |
+ self._eerror("preinst", msg) |
224 |
+ mydest = newdest |
225 |
+ |
226 |
elif stat.S_ISREG(mydmode) or (stat.S_ISLNK(mydmode) and os.path.exists(mydest) and stat.S_ISREG(os.stat(mydest)[stat.ST_MODE])): |
227 |
# install of destination is blocked by an existing regular file, |
228 |
# or by a symlink to an existing regular file; |
229 |
@@ -4903,6 +4913,7 @@ |
230 |
# we only need to tweak mydest if cfg file management is in play. |
231 |
if protected: |
232 |
# we have a protection path; enable config file management. |
233 |
+ cfgprot = 0 |
234 |
destmd5 = perform_md5(mydest, calc_prelink=1) |
235 |
if mymd5 == destmd5: |
236 |
#file already in place; simply update mtimes of destination |
237 |
@@ -4927,9 +4938,10 @@ |
238 |
"""A previously remembered update has been |
239 |
accepted, so it is removed from confmem.""" |
240 |
del cfgfiledict[myrealdest] |
241 |
- if cfgprot: |
242 |
- mydest = new_protect_filename(mydest, newmd5=mymd5) |
243 |
|
244 |
+ if cfgprot: |
245 |
+ mydest = new_protect_filename(mydest, newmd5=mymd5) |
246 |
+ |
247 |
# whether config protection or not, we merge the new file the |
248 |
# same way. Unless moveme=0 (blocking directory) |
249 |
if moveme: |
250 |
|
251 |
Modified: main/branches/prefix/pym/portage/dep.py |
252 |
=================================================================== |
253 |
--- main/branches/prefix/pym/portage/dep.py 2009-10-02 19:24:44 UTC (rev 14472) |
254 |
+++ main/branches/prefix/pym/portage/dep.py 2009-10-02 20:40:28 UTC (rev 14473) |
255 |
@@ -24,7 +24,7 @@ |
256 |
from portage.exception import InvalidData, InvalidAtom |
257 |
from portage.localization import _ |
258 |
from portage.versions import catpkgsplit, catsplit, \ |
259 |
- pkgcmp, pkgsplit, ververify, _version |
260 |
+ pkgcmp, pkgsplit, ververify, _cp, _cpv |
261 |
import portage.cache.mappings |
262 |
|
263 |
if sys.hexversion >= 0x3000000: |
264 |
@@ -806,28 +806,18 @@ |
265 |
|
266 |
# \w is [a-zA-Z0-9_] |
267 |
|
268 |
-# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-]. |
269 |
-# It must not begin with a hyphen or a dot. |
270 |
-_cat = r'[\w+][\w+.-]*' |
271 |
- |
272 |
-# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-]. |
273 |
-# It must not begin with a hyphen, |
274 |
-# and must not end in a hyphen followed by one or more digits. |
275 |
-_pkg = r'[\w+][\w+-]*?' |
276 |
- |
277 |
# 2.1.3 A slot name may contain any of the characters [A-Za-z0-9+_.-]. |
278 |
# It must not begin with a hyphen or a dot. |
279 |
-_slot = r':([\w+][\w+.-]*)' |
280 |
+_slot = r'([\w+][\w+.-]*)' |
281 |
+_slot_re = re.compile('^' + _slot + '$', re.VERBOSE) |
282 |
|
283 |
_use = r'\[.*\]' |
284 |
_op = r'([=~]|[><]=?)' |
285 |
-_cp = '(' + _cat + '/' + _pkg + '(-' + _version + ')?)' |
286 |
-_cpv = '(' + _cp + '-' + _version + ')' |
287 |
|
288 |
_atom_re = re.compile('^(?P<without_use>(?:' + |
289 |
'(?P<op>' + _op + _cpv + ')|' + |
290 |
'(?P<star>=' + _cpv + r'\*)|' + |
291 |
- '(?P<simple>' + _cp + '))(?:' + _slot + ')?)(' + _use + ')?$', re.VERBOSE) |
292 |
+ '(?P<simple>' + _cp + '))(:' + _slot + ')?)(' + _use + ')?$', re.VERBOSE) |
293 |
|
294 |
def isvalidatom(atom, allow_blockers=False): |
295 |
""" |
296 |
|
297 |
Modified: main/branches/prefix/pym/portage/versions.py |
298 |
=================================================================== |
299 |
--- main/branches/prefix/pym/portage/versions.py 2009-10-02 19:24:44 UTC (rev 14472) |
300 |
+++ main/branches/prefix/pym/portage/versions.py 2009-10-02 20:40:28 UTC (rev 14473) |
301 |
@@ -5,10 +5,28 @@ |
302 |
|
303 |
import re |
304 |
|
305 |
+ |
306 |
+# \w is [a-zA-Z0-9_] |
307 |
+ |
308 |
+# 2.1.1 A category name may contain any of the characters [A-Za-z0-9+_.-]. |
309 |
+# It must not begin with a hyphen or a dot. |
310 |
+_cat = r'[\w+][\w+.-]*' |
311 |
+ |
312 |
+# 2.1.2 A package name may contain any of the characters [A-Za-z0-9+_-]. |
313 |
+# It must not begin with a hyphen, |
314 |
+# and must not end in a hyphen followed by one or more digits. |
315 |
+_pkg = r'[\w+][\w+-]*?' |
316 |
+ |
317 |
+_v = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)' |
318 |
# PREFIX hack: -r(\d+) -> -r(\d+|0\d+\.\d+) (see below) |
319 |
-_version = r'(cvs\.)?(\d+)((\.\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\d*)*)(-r(\d+|0\d+\.\d+))?' |
320 |
+_rev = r'(\d+|0\d+\.\d+)' |
321 |
+_vr = _v + '(-r(' + _rev + '))?' |
322 |
|
323 |
-ver_regexp = re.compile("^" + _version + "$") |
324 |
+_cp = '(' + _cat + '/' + _pkg + '(-' + _vr + ')?)' |
325 |
+_cpv = '(' + _cp + '-' + _vr + ')' |
326 |
+_pv = '(?P<pn>' + _pkg + '(?P<pn_inval>-' + _vr + ')?)' + '-(?P<ver>' + _v + ')(-r(?P<rev>' + _rev + '))?' |
327 |
+ |
328 |
+ver_regexp = re.compile("^" + _vr + "$") |
329 |
suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") |
330 |
suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} |
331 |
endversion_keys = ["pre", "p", "alpha", "beta", "rc"] |
332 |
@@ -231,23 +249,15 @@ |
333 |
return None |
334 |
return vercmp("-".join(pkg1[1:]), "-".join(pkg2[1:])) |
335 |
|
336 |
-pkgcache={} |
337 |
+_pv_re = re.compile('^' + _pv + '$', re.VERBOSE) |
338 |
|
339 |
def pkgsplit(mypkg,silent=1): |
340 |
- try: |
341 |
- if not pkgcache[mypkg]: |
342 |
- return None |
343 |
- return pkgcache[mypkg] |
344 |
- except KeyError: |
345 |
- pass |
346 |
- myparts=mypkg.split("-") |
347 |
- |
348 |
- if len(myparts)<2: |
349 |
- if not silent: |
350 |
- print(_("!!! Name error in %s: missing a version or name part.") % mypkg) |
351 |
- pkgcache[mypkg]=None |
352 |
+ |
353 |
+ m = _pv_re.match(mypkg) |
354 |
+ if m is None: |
355 |
return None |
356 |
|
357 |
+<<<<<<< .working |
358 |
#verify rev |
359 |
revok=0 |
360 |
myrev=myparts[-1] |
361 |
@@ -275,8 +285,19 @@ |
362 |
return myval |
363 |
else: |
364 |
pkgcache[mypkg]=None |
365 |
+======= |
366 |
+ if m.group('pn_inval') is not None: |
367 |
+ # package name appears to have a version-like suffix |
368 |
+>>>>>>> .merge-right.r14472 |
369 |
return None |
370 |
|
371 |
+ rev = m.group('rev') |
372 |
+ if rev is None: |
373 |
+ rev = '0' |
374 |
+ rev = 'r' + rev |
375 |
+ |
376 |
+ return (m.group('pn'), m.group('ver'), rev) |
377 |
+ |
378 |
catcache={} |
379 |
def catpkgsplit(mydata,silent=1): |
380 |
""" |
381 |
|
382 |
Modified: main/branches/prefix/pym/repoman/checks.py |
383 |
=================================================================== |
384 |
--- main/branches/prefix/pym/repoman/checks.py 2009-10-02 19:24:44 UTC (rev 14472) |
385 |
+++ main/branches/prefix/pym/repoman/checks.py 2009-10-02 20:40:28 UTC (rev 14473) |
386 |
@@ -268,37 +268,6 @@ |
387 |
if match: |
388 |
return "Quoted \"${A}\" on line: %d" |
389 |
|
390 |
-class ImplicitRuntimeDeps(LineCheck): |
391 |
- """ |
392 |
- Detect the case where DEPEND is set and RDEPEND is unset in the ebuild, |
393 |
- since this triggers implicit RDEPEND=$DEPEND assignment. |
394 |
- """ |
395 |
- |
396 |
- _assignment_re = re.compile(r'^\s*(R?DEPEND)=') |
397 |
- |
398 |
- def new(self, pkg): |
399 |
- # RDEPEND=DEPEND is no longer available in EAPI=3 |
400 |
- if pkg.metadata['EAPI'] in ('0', '1', '2'): |
401 |
- self.repoman_check_name = 'RDEPEND.implicit' |
402 |
- else: |
403 |
- self.repoman_check_name = 'EAPI.incompatible' |
404 |
- self._rdepend = False |
405 |
- self._depend = False |
406 |
- |
407 |
- def check(self, num, line): |
408 |
- if not self._rdepend: |
409 |
- m = self._assignment_re.match(line) |
410 |
- if m is None: |
411 |
- pass |
412 |
- elif m.group(1) == "RDEPEND": |
413 |
- self._rdepend = True |
414 |
- elif m.group(1) == "DEPEND": |
415 |
- self._depend = True |
416 |
- |
417 |
- def end(self): |
418 |
- if self._depend and not self._rdepend: |
419 |
- yield 'RDEPEND is not explicitly assigned' |
420 |
- |
421 |
class InheritAutotools(LineCheck): |
422 |
""" |
423 |
Make sure appropriate functions are called in |
424 |
@@ -493,7 +462,7 @@ |
425 |
EbuildAssignment, EbuildUselessDodoc, |
426 |
EbuildUselessCdS, EbuildNestedDie, |
427 |
EbuildPatches, EbuildQuotedA, EapiDefinition, |
428 |
- IUseUndefined, ImplicitRuntimeDeps, InheritAutotools, |
429 |
+ IUseUndefined, InheritAutotools, |
430 |
EMakeParallelDisabled, EMakeParallelDisabledViaMAKEOPTS, |
431 |
DeprecatedBindnowFlags, SrcUnpackPatches, WantAutoDefaultValue, |
432 |
SrcCompileEconf, Eapi3IncompatibleFuncs, Eapi3GoneVars))) |