summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Pkgmgr.py
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/lib/Server/Plugins/Pkgmgr.py
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/lib/Server/Plugins/Pkgmgr.py')
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py15
1 files changed, 12 insertions, 3 deletions
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: