summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-06-30 20:26:24 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-06-30 20:26:24 +0000
commit200a577626f891a6f2ca155d51f66914436a122f (patch)
treef5d747c868eb587d09ae73d78cf8832e4b11fe5b /src
parentdae5ede5f40b3600f28cacab25414e954034b209 (diff)
downloadbcfg2-200a577626f891a6f2ca155d51f66914436a122f.tar.gz
bcfg2-200a577626f891a6f2ca155d51f66914436a122f.tar.bz2
bcfg2-200a577626f891a6f2ca155d51f66914436a122f.zip
Implement multiarch support (resolves Ticket #52)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1908 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Redhat.py13
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py15
2 files changed, 25 insertions, 3 deletions
diff --git a/src/lib/Client/Redhat.py b/src/lib/Client/Redhat.py
index 80aa3a8c8..e980ad9c1 100644
--- a/src/lib/Client/Redhat.py
+++ b/src/lib/Client/Redhat.py
@@ -93,6 +93,19 @@ class ToolsetImpl(Toolset):
return False
if self.installed.has_key(entry.get('name')):
if entry.get('version') == self.installed[entry.get('name')]:
+ if entry.get('multiarch'):
+ archs = entry.get('multiarch').split()
+ info = self.saferun('rpm -q %s --qf "%{NAME} %{VERSION}-%{RELEASE} %{ARCH}\n"' % (entry.get('name')))[1]
+ while info:
+ (_, vers, arch) = info.pop()
+ if arch in archs:
+ archs.remove(arch)
+ else:
+ self.logger.error("Got pkg install for Package %s: arch %s" % (entry.get('name'), arch))
+ return False
+ if archs:
+ self.logger.error("Package %s not installed for arch: %s" % (entry.get('name'), archs))
+ return False
if (self.setup['quick'] or (entry.get('verify', 'true') == 'false')):
if entry.get('verify', 'true') == 'false':
self.logger.debug("Skipping checksum verification for package %s" % (entry.get('name')))
diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py
index 563a7c448..d358127c4 100644
--- a/src/lib/Server/Plugins/Pkgmgr.py
+++ b/src/lib/Server/Plugins/Pkgmgr.py
@@ -7,8 +7,8 @@ logger = logging.getLogger('Bcfg2.Plugins.Pkgmgr')
class PNode(Bcfg2.Server.Plugin.INode):
'''PNode has a list of packages available at a particular group intersection'''
- splitters = {'rpm':re.compile('^(?P<name>[\w\+\d\.]+(-[\w\+\d\.]+)*)-' + \
- '(?P<version>[\w\d\.]+-([\w\d\.]+))\.(?P<arch>\w+)\.rpm$'),
+ splitters = {'rpm':re.compile('^(.*/)?(?P<name>[\w\+\d\.]+(-[\w\+\d\.]+)*)-' + \
+ '(?P<version>[\w\d\.]+-([\w\d\.]+))\.(?P<arch>\S+)\.rpm$'),
'encap':re.compile('^(?P<name>\w+)-(?P<version>[\w\d\.-]+).encap.*$')}
ignore = ['Package']
@@ -30,7 +30,14 @@ class PNode(Bcfg2.Server.Plugin.INode):
self.contents['Package'][pkg.get('name')] = pkg.attrib
else:
if pkg.attrib.has_key('file'):
- pkg.set('url', '%s/%s' % (pkg.get('uri'), pkg.get('file')))
+ if pkg.attrib.has_key('multiarch'):
+ archs = pkg.get('multiarch').split()
+ srcs = pkg.get('srcs', pkg.get('multiarch')).split()
+ url = ' '.join(["%s/%s" % (pkg.get('uri'), pkg.get('file') % (srcs[idx], archs[idx]))
+ for idx in range(len(archs))])
+ pkg.set('url', url)
+ else:
+ pkg.set('url', '%s/%s' % (pkg.get('uri'), pkg.get('file')))
if self.splitters.has_key(pkg.get('type')) and pkg.get('file') != None:
mdata = self.splitters[pkg.get('type')].match(pkg.get('file'))
if not mdata:
@@ -43,6 +50,8 @@ class PNode(Bcfg2.Server.Plugin.INode):
self.contents['Package'][pkgname]['type'] = pkg.get('type')
if pkg.get('verify'):
self.contents['Package'][pkgname]['verify'] = pkg.get('verify')
+ if pkg.get('multiarch'):
+ self.contents['Package'][pkgname]['multiarch'] = pkg.get('multiarch')
if pkgname not in pdict['Package']:
pdict['Package'].append(pkgname)
else: