summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-09-23 09:46:25 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-09-23 09:46:25 +0000
commit673ad8f4936409a83d8f9fffd9da0f93d249364a (patch)
treec2da52902e3e6a771631ee03bb60162595ad193c
parentba84e728c008d134a12ddc5ab66a81bfa17c2650 (diff)
downloadbcfg2-673ad8f4936409a83d8f9fffd9da0f93d249364a.tar.gz
bcfg2-673ad8f4936409a83d8f9fffd9da0f93d249364a.tar.bz2
bcfg2-673ad8f4936409a83d8f9fffd9da0f93d249364a.zip
Packages: rework apt dependency choices
Don't force use of a particular prereq choice. This causes additional unknown entries in package dep resolution, but removes incorrect dependency choice hardwiring. This effect can be mitigated by listing package prereq choices explicitly. Eventually, we should implement apt's choice of last resort algorithm for Packages. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5454 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Plugins/Packages.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Packages.py b/src/lib/Server/Plugins/Packages.py
index e55017a7d..800be5bab 100644
--- a/src/lib/Server/Plugins/Packages.py
+++ b/src/lib/Server/Plugins/Packages.py
@@ -395,13 +395,18 @@ class APTSource(Source):
self.pkgnames.add(pkgname)
elif words[0] == 'Depends':
bdeps[bin][pkgname] = []
+ vindex = 0
for dep in words[1].split(','):
raw_dep = re.sub('\(.*\)', '', dep)
if '|' in raw_dep:
- # FIXME hack alert
- raw_dep = raw_dep.split('|')[0]
- raw_dep = raw_dep.rstrip().strip()
- bdeps[bin][pkgname].append(raw_dep)
+ dyn_dname = "choice-%s-%s-%s" % (pkgname, bin, vindex)
+ vindex += 1
+ bdeps[bin][pkgname].append(dyn_dname)
+ dyn_list = [x.strip() for x in raw_dep.split('|')]
+ bprov[bin][dyn_dname] = set(dyn_list)
+ else:
+ raw_dep = raw_dep.rstrip().strip()
+ bdeps[bin][pkgname].append(raw_dep)
elif words[0] == 'Provides':
for pkg in words[1].split(','):
dname = pkg.rstrip().strip()