Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10516 - in main/trunk/pym: _emerge portage
Date: Sat, 31 May 2008 09:11:32
Message-Id: E1K2N7W-0001H6-TU@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-05-31 09:11:25 +0000 (Sat, 31 May 2008)
3 New Revision: 10516
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 main/trunk/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
17
18 Modified: main/trunk/pym/_emerge/__init__.py
19 ===================================================================
20 --- main/trunk/pym/_emerge/__init__.py 2008-05-31 02:08:25 UTC (rev 10515)
21 +++ main/trunk/pym/_emerge/__init__.py 2008-05-31 09:11:25 UTC (rev 10516)
22 @@ -6427,8 +6427,7 @@
23 sys.exit(1)
24
25 if not mymatch and x[0] not in "<>=~":
26 - #add a "=" if missing
27 - mymatch=localtree.dep_match("="+x)
28 + mymatch = localtree.dep_match(x)
29 if not mymatch:
30 portage.writemsg("\n--- Couldn't find '%s' to %s.\n" % \
31 (x, unmerge_action), noiselevel=-1)
32
33 Modified: main/trunk/pym/portage/dep.py
34 ===================================================================
35 --- main/trunk/pym/portage/dep.py 2008-05-31 02:08:25 UTC (rev 10515)
36 +++ main/trunk/pym/portage/dep.py 2008-05-31 09:11:25 UTC (rev 10516)
37 @@ -593,19 +593,30 @@
38 if allow_blockers and atom.startswith("!"):
39 atom = atom[1:]
40 cpv = dep_getcpv(atom)
41 + cpv_catsplit = catsplit(cpv)
42 + mycpv_cps = None
43 if cpv:
44 - if _valid_category.match(catsplit(cpv)[0]) is None:
45 - return 0
46 - mycpv_cps = catpkgsplit(cpv)
47 - else:
48 - mycpv_cps = None
49 + if len(cpv_catsplit) == 2:
50 + if _valid_category.match(cpv_catsplit[0]) is None:
51 + return 0
52 + if cpv_catsplit[0] == "null":
53 + # "null" category is valid, missing category is not.
54 + mycpv_cps = catpkgsplit(cpv.replace("null/", "cat/", 1))
55 + if mycpv_cps:
56 + mycpv_cps[0] = "null"
57 + if not mycpv_cps:
58 + mycpv_cps = catpkgsplit(cpv)
59 +
60 operator = get_operator(atom)
61 if operator:
62 if operator[0] in "<>" and remove_slot(atom).endswith("*"):
63 return 0
64 - if mycpv_cps and mycpv_cps[0] != "null":
65 - # >=cat/pkg-1.0
66 - return 1
67 + if mycpv_cps:
68 + if len(cpv_catsplit) == 2:
69 + # >=cat/pkg-1.0
70 + return 1
71 + else:
72 + return 0
73 else:
74 # >=cat/pkg or >=pkg-1.0 (no category)
75 return 0
76 @@ -613,7 +624,7 @@
77 # cat/pkg-1.0
78 return 0
79
80 - if (len(atom.split('/')) == 2):
81 + if len(cpv_catsplit) == 2:
82 # cat/pkg
83 return 1
84 else:
85
86 --
87 gentoo-commits@l.g.o mailing list