summaryrefslogtreecommitdiffstats
path: root/comps.py
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-05-05 17:44:55 +0000
committerErik Troan <ewt@redhat.com>1999-05-05 17:44:55 +0000
commite3586c66048c4a94ecbd1671fe2f0ce0a0c262ff (patch)
treeda3a918fa68c13b4c85047d551169d0f151718ff /comps.py
parent79ebb2cf474e61eebc6074752a95f072bc99c86f (diff)
downloadanaconda-e3586c66048c4a94ecbd1671fe2f0ce0a0c262ff.tar.gz
anaconda-e3586c66048c4a94ecbd1671fe2f0ce0a0c262ff.tar.xz
anaconda-e3586c66048c4a94ecbd1671fe2f0ce0a0c262ff.zip
1) handle ! in component file
2) filter archs properly
Diffstat (limited to 'comps.py')
-rw-r--r--comps.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/comps.py b/comps.py
index 8a354e006..2a57217d0 100644
--- a/comps.py
+++ b/comps.py
@@ -77,13 +77,20 @@ class ComponentSet:
if (find(l, ":") > -1):
(archList, l) = split(l, ":", 1)
while (l[0] == " "): l = l[1:]
+
+ skipIfFound = 0
+ if (archList[0] == '!'):
+ skipIfFound = 1
+ archList = archList[:2]
archList = split(archList)
- skip = 1
+ found = 0
for n in archList:
if (n == arch):
- skip = 0
+ found = 1
break
- if (skip): continue
+ if ((found and skipIfFound) or
+ (not found and not skipIfFound)):
+ continue
if (comp == None):
(default, l) = split(l, None, 1)
@@ -122,5 +129,12 @@ class ComponentSet:
self.list = []
self.packages = {}
for h in hdlist:
- self.packages[h[rpm.RPMTAG_NAME]] = Package(h)
+ name = h[rpm.RPMTAG_NAME]
+ if self.packages.has_key(name):
+ score1 = rpm.archscore(h[rpm.RPMTAG_ARCH])
+ score2 = rpm.archscore(self.packages[name].h[rpm.RPMTAG_ARCH])
+ if (score2 < score1):
+ self.packages[h[rpm.RPMTAG_NAME]] = Package(h)
+ else:
+ self.packages[h[rpm.RPMTAG_NAME]] = Package(h)
self.readCompsFile(arch, file, self.packages)