summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-28 12:39:35 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-28 12:39:35 +0000
commit486628dd25d0731808d10b4832afefad90ee8959 (patch)
treedc097ddcce01c64a6041e4a8a4907ea2a4a169f7 /bin
parent7e2833fda5456e69674a6b5d18d63fed120fe27e (diff)
downloadportage-486628dd25d0731808d10b4832afefad90ee8959.tar.gz
portage-486628dd25d0731808d10b4832afefad90ee8959.tar.bz2
portage-486628dd25d0731808d10b4832afefad90ee8959.zip
Bug #211294 - Make repoman bail out if arch.list contains unrecognized
lines since we don't want people to commit with old versions of portage that don't support the current arch.list format. (trunk r9504) svn path=/main/branches/2.1.2/; revision=9568
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman15
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/repoman b/bin/repoman
index 7552bc58f..db1dbd90c 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -814,15 +814,24 @@ elif repolevel==3:
scanlist.sort()
profiles={}
+valid_profile_types = frozenset(["dev", "exp", "stable"])
descfile=portdir+"/profiles/profiles.desc"
if os.path.exists(descfile):
- for x in portage.grabfile(descfile):
+ for i, x in enumerate(open(descfile, 'rb')):
if x[0]=="#":
continue
arch=x.split()
- if len(arch)!=3:
- print "wrong format: \""+red(x)+"\" in "+descfile
+ if len(arch) == 0:
continue
+ if len(arch)!=3:
+ err("wrong format: \"" + bad(x.strip()) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
+ elif arch[0] not in kwlist:
+ err("invalid arch: \"" + bad(arch[0]) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
+ elif arch[2] not in valid_profile_types:
+ err("invalid profile type: \"" + bad(arch[2]) + "\" in " + \
+ descfile + " line %d" % (i+1, ))
if not os.path.isdir(portdir+"/profiles/"+arch[1]):
print "Invalid "+arch[2]+" profile ("+arch[1]+") for arch "+arch[0]
continue