1 |
betelgeuse 08/11/30 17:15:33 |
2 |
|
3 |
Added: equery-0.2.4.2_use_expanded.patch |
4 |
Log: |
5 |
Add patch to read USE expanded variables from their desc files. Fixes bug #238005. Thanks to Michael A. Smith <michael@××××××××.com>. |
6 |
(Portage version: 2.1.6_rc2/cvs/Linux 2.6.27-gentoo-r2 i686) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 app-portage/gentoolkit/files/equery-0.2.4.2_use_expanded.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-portage/gentoolkit/files/equery-0.2.4.2_use_expanded.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-portage/gentoolkit/files/equery-0.2.4.2_use_expanded.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: equery-0.2.4.2_use_expanded.patch |
15 |
=================================================================== |
16 |
--- gentoolkit-0.2.4.2/src/equery/equery 2008-11-27 10:25:21.000000000 -0500 |
17 |
+++ gentoolkit-0.2.4.2/src/equery/equery 2008-11-27 10:29:09.000000000 -0500 |
18 |
@@ -17,6 +17,7 @@ |
19 |
import re |
20 |
import sys |
21 |
import time |
22 |
+from glob import glob |
23 |
|
24 |
# portage (output module) and gentoolkit need special path modifications |
25 |
sys.path.insert(0, "/usr/lib/gentoolkit/pym") |
26 |
@@ -529,6 +530,20 @@ |
27 |
except IOError: |
28 |
print_warn(5, "Could not load USE flag descriptions from " + ppath(gentoolkit.settings["PORTDIR"] + "/profiles/use.desc")) |
29 |
|
30 |
+ # Add USE_EXPANDED variables to usedesc hash -- Bug #238005 |
31 |
+ for descfile in glob(gentoolkit.settings["PORTDIR"]+"/profiles/desc/*.desc"): |
32 |
+ try: |
33 |
+ fd = open(descfile) |
34 |
+ for line in fd.readlines(): |
35 |
+ if line[0] == "#": |
36 |
+ continue |
37 |
+ fields = [field.strip() for field in line.split(" - ", 1)] |
38 |
+ if len(fields) == 2: |
39 |
+ expanded_useflag = "%s_%s" % (descfile.split("/")[-1][0:-5], fields[0],) |
40 |
+ usedesc[expanded_useflag] = fields[1] |
41 |
+ except IOError: |
42 |
+ print_warn(5, "Could not load USE flag descriptions from " + descfile) |
43 |
+ |
44 |
# Load local USE flag descriptions |
45 |
try: |
46 |
fd = open(gentoolkit.settings["PORTDIR"]+"/profiles/use.local.desc") |