From 673ad8f4936409a83d8f9fffd9da0f93d249364a Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Wed, 23 Sep 2009 09:46:25 +0000 Subject: 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 --- src/lib/Server/Plugins/Packages.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') 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() -- cgit v1.2.3-1-g7c22