1 |
Author: zmedico |
2 |
Date: 2008-03-28 12:39:35 +0000 (Fri, 28 Mar 2008) |
3 |
New Revision: 9568 |
4 |
|
5 |
Modified: |
6 |
main/branches/2.1.2/bin/repoman |
7 |
Log: |
8 |
Bug #211294 - Make repoman bail out if arch.list contains unrecognized |
9 |
lines since we don't want people to commit with old versions of portage |
10 |
that don't support the current arch.list format. (trunk r9504) |
11 |
|
12 |
|
13 |
Modified: main/branches/2.1.2/bin/repoman |
14 |
=================================================================== |
15 |
--- main/branches/2.1.2/bin/repoman 2008-03-28 12:36:43 UTC (rev 9567) |
16 |
+++ main/branches/2.1.2/bin/repoman 2008-03-28 12:39:35 UTC (rev 9568) |
17 |
@@ -814,15 +814,24 @@ |
18 |
scanlist.sort() |
19 |
|
20 |
profiles={} |
21 |
+valid_profile_types = frozenset(["dev", "exp", "stable"]) |
22 |
descfile=portdir+"/profiles/profiles.desc" |
23 |
if os.path.exists(descfile): |
24 |
- for x in portage.grabfile(descfile): |
25 |
+ for i, x in enumerate(open(descfile, 'rb')): |
26 |
if x[0]=="#": |
27 |
continue |
28 |
arch=x.split() |
29 |
+ if len(arch) == 0: |
30 |
+ continue |
31 |
if len(arch)!=3: |
32 |
- print "wrong format: \""+red(x)+"\" in "+descfile |
33 |
- continue |
34 |
+ err("wrong format: \"" + bad(x.strip()) + "\" in " + \ |
35 |
+ descfile + " line %d" % (i+1, )) |
36 |
+ elif arch[0] not in kwlist: |
37 |
+ err("invalid arch: \"" + bad(arch[0]) + "\" in " + \ |
38 |
+ descfile + " line %d" % (i+1, )) |
39 |
+ elif arch[2] not in valid_profile_types: |
40 |
+ err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \ |
41 |
+ descfile + " line %d" % (i+1, )) |
42 |
if not os.path.isdir(portdir+"/profiles/"+arch[1]): |
43 |
print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0] |
44 |
continue |
45 |
|
46 |
-- |
47 |
gentoo-commits@l.g.o mailing list |