1 |
Author: zmedico |
2 |
Date: 2008-05-31 09:17:07 +0000 (Sat, 31 May 2008) |
3 |
New Revision: 10517 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/emerge |
7 |
main/branches/2.1.2/pym/portage_dep.py |
8 |
Log: |
9 |
* Tweak isvalidatom() to treat "null" category as valid, but missing category |
10 |
as invalid (previously both where treated as invalid). |
11 |
|
12 |
* Fix a spot inside emerge's unmerge() function that sometimes generates |
13 |
invalid atoms by adding an unnecessary "=" to the front. Even when in |
14 |
cases that resulted in a valid atom here, adding the "=" was redundant |
15 |
because dep_expand() does that automatically now (for backward compat). |
16 |
(trunk r10516) |
17 |
|
18 |
|
19 |
Modified: main/branches/2.1.2/bin/emerge |
20 |
=================================================================== |
21 |
--- main/branches/2.1.2/bin/emerge 2008-05-31 09:11:25 UTC (rev 10516) |
22 |
+++ main/branches/2.1.2/bin/emerge 2008-05-31 09:17:07 UTC (rev 10517) |
23 |
@@ -6510,8 +6510,7 @@ |
24 |
sys.exit(1) |
25 |
|
26 |
if not mymatch and x[0] not in "<>=~": |
27 |
- #add a "=" if missing |
28 |
- mymatch=localtree.dep_match("="+x) |
29 |
+ mymatch = localtree.dep_match(x) |
30 |
if not mymatch: |
31 |
portage.writemsg("\n--- Couldn't find '%s' to %s.\n" % \ |
32 |
(x, unmerge_action), noiselevel=-1) |
33 |
|
34 |
Modified: main/branches/2.1.2/pym/portage_dep.py |
35 |
=================================================================== |
36 |
--- main/branches/2.1.2/pym/portage_dep.py 2008-05-31 09:11:25 UTC (rev 10516) |
37 |
+++ main/branches/2.1.2/pym/portage_dep.py 2008-05-31 09:17:07 UTC (rev 10517) |
38 |
@@ -433,19 +433,30 @@ |
39 |
if allow_blockers and atom.startswith("!"): |
40 |
atom = atom[1:] |
41 |
cpv = dep_getcpv(atom) |
42 |
+ cpv_catsplit = catsplit(cpv) |
43 |
+ mycpv_cps = None |
44 |
if cpv: |
45 |
- if _valid_category.match(catsplit(cpv)[0]) is None: |
46 |
- return 0 |
47 |
- mycpv_cps = catpkgsplit(cpv) |
48 |
- else: |
49 |
- mycpv_cps = None |
50 |
+ if len(cpv_catsplit) == 2: |
51 |
+ if _valid_category.match(cpv_catsplit[0]) is None: |
52 |
+ return 0 |
53 |
+ if cpv_catsplit[0] == "null": |
54 |
+ # "null" category is valid, missing category is not. |
55 |
+ mycpv_cps = catpkgsplit(cpv.replace("null/", "cat/", 1)) |
56 |
+ if mycpv_cps: |
57 |
+ mycpv_cps[0] = "null" |
58 |
+ if not mycpv_cps: |
59 |
+ mycpv_cps = catpkgsplit(cpv) |
60 |
+ |
61 |
operator = get_operator(atom) |
62 |
if operator: |
63 |
if operator[0] in "<>" and remove_slot(atom).endswith("*"): |
64 |
return 0 |
65 |
- if mycpv_cps and mycpv_cps[0] != "null": |
66 |
- # >=cat/pkg-1.0 |
67 |
- return 1 |
68 |
+ if mycpv_cps: |
69 |
+ if len(cpv_catsplit) == 2: |
70 |
+ # >=cat/pkg-1.0 |
71 |
+ return 1 |
72 |
+ else: |
73 |
+ return 0 |
74 |
else: |
75 |
# >=cat/pkg or >=pkg-1.0 (no category) |
76 |
return 0 |
77 |
@@ -453,7 +464,7 @@ |
78 |
# cat/pkg-1.0 |
79 |
return 0 |
80 |
|
81 |
- if (len(atom.split('/')) == 2): |
82 |
+ if len(cpv_catsplit) == 2: |
83 |
# cat/pkg |
84 |
return 1 |
85 |
else: |
86 |
|
87 |
-- |
88 |
gentoo-commits@l.g.o mailing list |