Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9504 - main/trunk/bin
Date: Tue, 25 Mar 2008 03:18:34
Message-Id: E1JdzgD-0007o8-MK@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-25 03:18:28 +0000 (Tue, 25 Mar 2008)
3 New Revision: 9504
4
5 Modified:
6 main/trunk/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.
11
12
13 Modified: main/trunk/bin/repoman
14 ===================================================================
15 --- main/trunk/bin/repoman 2008-03-24 23:14:37 UTC (rev 9503)
16 +++ main/trunk/bin/repoman 2008-03-25 03:18:28 UTC (rev 9504)
17 @@ -569,15 +569,24 @@
18 logging.debug("Found the following packages to scan:\n%s" % '\n'.join(scanlist))
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