From fbbd7f65a1e6da56b0a1da12be59a1887e310a42 Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Thu, 19 Jul 2007 02:10:32 +0000 Subject: Change encap splitting regular expressions to allow package names with dashes and version names with pluses. Should solve ticket #467 (except for the not complaining about epkg.log thing, but that seems harmless). http://kodos.sourceforge.net/ is your friend. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@3482 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Client/Tools/Encap.py | 6 +++--- src/lib/Server/Plugins/Pkgmgr.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/Client/Tools/Encap.py b/src/lib/Client/Tools/Encap.py index 102eb0987..24e124103 100644 --- a/src/lib/Client/Tools/Encap.py +++ b/src/lib/Client/Tools/Encap.py @@ -12,9 +12,9 @@ class Encap(Bcfg2.Client.Tools.PkgTool): __req__ = {'Package': ['version', 'url']} pkgtype = 'encap' pkgtool = ("/usr/local/bin/epkg -l -f -q %s", ("%s", ["url"])) - splitter = re.compile('.*/(?P[\w-]+)\-(?P[\w\.-]+)') + splitter = re.compile('.*/(?P[\w-]+)\-(?P[\w\.+-]+)') -# If you define self.pkgtool and self.pkgname it will [use] the Pkgtool.Install +# If you define self.pkgtool and self.pkgname it will [use] the Pkgtool.Install # method will do the installation stuff for you def RefreshPackages(self): @@ -28,7 +28,7 @@ class Encap(Bcfg2.Client.Tools.PkgTool): print "Failed to split name %s" % pkg self.logger.debug("Encap.py: RefreshPackages: self.installed.keys() are:") self.logger.debug("%s" % self.installed.keys()) - + def VerifyPackage(self, entry, _): '''Verify Package status for entry''' if not entry.get('version'): diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py index e212e0c95..9dc05352d 100644 --- a/src/lib/Server/Plugins/Pkgmgr.py +++ b/src/lib/Server/Plugins/Pkgmgr.py @@ -9,9 +9,9 @@ class PNode(Bcfg2.Server.Plugin.INode): '''PNode has a list of packages available at a particular group intersection''' splitters = {'rpm':re.compile('^(.*/)?(?P[\w\+\d\.]+(-[\w\+\d\.]+)*)-' + \ '(?P[\w\d\.]+-([\w\d\.]+))\.(?P\S+)\.rpm$'), - 'encap':re.compile('^(?P\w+)-(?P[\w\d\.-]+).encap.*$')} + 'encap':re.compile('^(?P[\w-]+)-(?P[\w\d\.+-]+).encap.*$')} ignore = ['Package'] - + def __init__(self, data, pdict, parent=None): # copy local attributes to all child nodes if no local attribute exists if not pdict.has_key('Package'): @@ -68,7 +68,7 @@ class PNode(Bcfg2.Server.Plugin.INode): self.contents['Package'][pkgname]['__children__'] = pkg.getchildren() else: self.contents['Package'][pkg.get('name')].update(pkg.attrib) - + class PkgSrc(Bcfg2.Server.Plugin.XMLSrc): '''PkgSrc files contain a PNode hierarchy that returns matching package entries''' -- cgit v1.2.3-1-g7c22