1 |
Author: zmedico |
2 |
Date: 2009-04-30 07:17:50 +0000 (Thu, 30 Apr 2009) |
3 |
New Revision: 13514 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.6/bin/repoman |
7 |
Log: |
8 |
Support use.desc from overlays. (trunk r13358) |
9 |
|
10 |
Modified: main/branches/2.1.6/bin/repoman |
11 |
=================================================================== |
12 |
--- main/branches/2.1.6/bin/repoman 2009-04-30 07:17:28 UTC (rev 13513) |
13 |
+++ main/branches/2.1.6/bin/repoman 2009-04-30 07:17:50 UTC (rev 13514) |
14 |
@@ -540,33 +540,40 @@ |
15 |
def caterror(mycat): |
16 |
err(mycat+" is not an official category. Skipping QA checks in this directory.\nPlease ensure that you add "+catdir+" to "+repodir+"/profiles/categories\nif it is a new category.") |
17 |
|
18 |
-# setup a uselist from portage |
19 |
-uselist=[] |
20 |
-try: |
21 |
- uselist=portage.grabfile(portdir+"/profiles/use.desc") |
22 |
- for l in range(0,len(uselist)): |
23 |
- uselist[l]=uselist[l].split()[0] |
24 |
- for var in repoman_settings["USE_EXPAND"].split(): |
25 |
- vardescs = portage.grabfile(portdir+"/profiles/desc/"+var.lower()+".desc") |
26 |
- for l in range(0, len(vardescs)): |
27 |
- uselist.append(var.lower() + "_" + vardescs[l].split()[0]) |
28 |
-except (IOError, OSError, ParseError), e: |
29 |
- logging.exception("Couldn't read USE flags from use.desc") |
30 |
- sys.exit(1) |
31 |
+# get lists of valid keywords, licenses, and use |
32 |
+kwlist = set() |
33 |
+liclist = set() |
34 |
+uselist = set() |
35 |
|
36 |
-# get lists of valid keywords and licenses |
37 |
-kwlist = set(portage.grabfile(os.path.join(portdir, "profiles", "arch.list"))) |
38 |
-liclist = set(portage.listdir(os.path.join(portdir, "licenses"))) |
39 |
+for path in portdb.porttrees: |
40 |
+ try: |
41 |
+ liclist.update(os.listdir(os.path.join(path, "licenses"))) |
42 |
+ except OSError: |
43 |
+ pass |
44 |
+ kwlist.update(portage.grabfile(os.path.join(path, |
45 |
+ "profiles", "arch.list"))) |
46 |
|
47 |
-if portdir_overlay != portdir: |
48 |
- for porttree in portdb.porttrees[1:]: |
49 |
- try: |
50 |
- liclist.update(os.listdir(os.path.join(porttree, "licenses"))) |
51 |
- except OSError: |
52 |
- pass |
53 |
- kwlist.update(portage.grabfile(os.path.join(porttree, |
54 |
- "profiles", "arch.list"))) |
55 |
+ use_desc = portage.grabfile(os.path.join(path, 'profiles', 'use.desc')) |
56 |
+ for x in use_desc: |
57 |
+ x = x.split() |
58 |
+ if x: |
59 |
+ uselist.add(x[0]) |
60 |
|
61 |
+ expand_desc_dir = os.path.join(path, 'profiles', 'desc') |
62 |
+ try: |
63 |
+ expand_list = os.listdir(expand_desc_dir) |
64 |
+ except OSError: |
65 |
+ pass |
66 |
+ else: |
67 |
+ for fn in expand_list: |
68 |
+ if not fn[-5:] == '.desc': |
69 |
+ continue |
70 |
+ use_prefix = fn[:-5].lower() + '_' |
71 |
+ for x in portage.grabfile(os.path.join(expand_desc_dir, fn)): |
72 |
+ x = x.split() |
73 |
+ if x: |
74 |
+ uselist.add(use_prefix + x[0]) |
75 |
+ |
76 |
if not liclist: |
77 |
logging.fatal("Couldn't find licenses?") |
78 |
sys.exit(1) |
79 |
@@ -575,6 +582,10 @@ |
80 |
logging.fatal("Couldn't read KEYWORDS from arch.list") |
81 |
sys.exit(1) |
82 |
|
83 |
+if not uselist: |
84 |
+ logging.fatal("Couldn't find use.desc?") |
85 |
+ sys.exit(1) |
86 |
+ |
87 |
scanlist=[] |
88 |
if repolevel==2: |
89 |
#we are inside a category directory |