From 1429df0049ac5134352a35f24ca62ff9aed7d6d3 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 21 May 2009 19:34:28 +0000 Subject: Include ignores for Pkgmgr updates (patch from zultron) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5250 ce84e21b-d406-0410-9b95-82705330c041 --- tools/pkgmgr_update.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tools') diff --git a/tools/pkgmgr_update.py b/tools/pkgmgr_update.py index 9f7a1fa98..90c1ab6f1 100755 --- a/tools/pkgmgr_update.py +++ b/tools/pkgmgr_update.py @@ -253,15 +253,33 @@ def updatepkg(pkg): inst.attrib['release'] = latest['release'] if inst.get('simplefile', False): inst.attrib['simplefile'] = latest['filename'] + if options.altconfigfile: + ignoretags = pkg.xpath(".//Ignore") + # if we find Ignore tags, then assume they're correct; + # otherwise, check the altconfigfile + if not ignoretags: + altpkgs = alttree.xpath(".//Package[@name='%s'][Ignore]"%name) + if (len(altpkgs) == 1): + for ignoretag in altpkgs[0].xpath(".//Ignore"): + if options.verbose: + print(" Found Ignore tag in altconfigfile for package %s" % name) + pkg.append(ignoretag) def main(): global package_dict + global alttree if options.verbose: print 'Loading Pkgmgr config file %s.' % (options.configfile) tree = parse(options.configfile) config = tree.getroot() + if options.altconfigfile: + if options.verbose: + print 'Loading Pkgmgr alternate config file %s.' % (options.altconfigfile) + + alttree = parse(options.altconfigfile) + if options.verbose: print 'Loading package headers' @@ -286,6 +304,11 @@ if __name__ == "__main__": type='string', \ help='Existing Pkgmgr configuration file name.') + p.add_option('--altconfigfile', '-a', action='store', \ + type='string', \ + help='''Alternate, existing Pkgmgr configuration file name to read + Ignore tags from (used for upgrades).''') + p.add_option('--rpmdirs', '-d', action='store', type='string', \ help='''Comma separated list of directories to scan for RPMS. -- cgit v1.2.3-1-g7c22