summaryrefslogtreecommitdiffstats
path: root/tools/pkgmgr_update.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-05-21 19:34:28 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-05-21 19:34:28 +0000
commit1429df0049ac5134352a35f24ca62ff9aed7d6d3 (patch)
treededc0ed0b00e22be2b8e2d7f39ead3a2c83d89d3 /tools/pkgmgr_update.py
parent3419c67e473c171d5cff9b669427da96f71b000c (diff)
downloadbcfg2-1429df0049ac5134352a35f24ca62ff9aed7d6d3.tar.gz
bcfg2-1429df0049ac5134352a35f24ca62ff9aed7d6d3.tar.bz2
bcfg2-1429df0049ac5134352a35f24ca62ff9aed7d6d3.zip
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
Diffstat (limited to 'tools/pkgmgr_update.py')
-rwxr-xr-xtools/pkgmgr_update.py23
1 files changed, 23 insertions, 0 deletions
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.