summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2009-08-03 13:43:47 -0400
committerBill Peck <bpeck@redhat.com>2009-08-03 13:43:47 -0400
commit8e86b2ce53d0fa7bd58dc6a120793c75ee6f1bc6 (patch)
tree1db76a158b1a4e3d9f7717337609366fd193307d
parent1a4fac61588ab92a35b1951354aab0790f241a25 (diff)
newest rawhide uses xz compressor for rpm, dont know how to handle that yet. luckily .treeinfo saves the day
-rwxr-xr-xLabController/triggers/sync/post/osversion.trigger49
1 files changed, 26 insertions, 23 deletions
diff --git a/LabController/triggers/sync/post/osversion.trigger b/LabController/triggers/sync/post/osversion.trigger
index be7960a..1ed2e2e 100755
--- a/LabController/triggers/sync/post/osversion.trigger
+++ b/LabController/triggers/sync/post/osversion.trigger
@@ -149,29 +149,32 @@ def update_comment(distro):
return False
filename = data2[0]
cpio_object = tempfile.TemporaryFile()
- rpm2cpio(filename,cpio_object)
- cpio_object.seek(0)
- cpio = cpioarchive.CpioArchive(fileobj=cpio_object)
- for entry in cpio:
- if entry.name == './etc/fedora-release':
- release = entry.read().split('\n')[0]
- releaseregex = re.compile(r'(.*)\srelease\s(\d+).(\d*)')
- if releaseregex.search(release):
- family = "%s%s" % (releaseregex.search(release).group(1),
- releaseregex.search(release).group(2))
- if releaseregex.search(release).group(3):
- update = releaseregex.search(release).group(3)
- else:
- update = 0
- if entry.name == './etc/redhat-release':
- release = entry.read().split('\n')[0]
- updateregex = re.compile(r'Update\s(\d+)')
- releaseregex = re.compile(r'release\s\d+.(\d+)')
- if updateregex.search(release):
- update = updateregex.search(release).group(1)
- if releaseregex.search(release):
- update = releaseregex.search(release).group(1)
- cpio_object.close()
+ try:
+ rpm2cpio(filename,cpio_object)
+ cpio_object.seek(0)
+ cpio = cpioarchive.CpioArchive(fileobj=cpio_object)
+ for entry in cpio:
+ if entry.name == './etc/fedora-release':
+ release = entry.read().split('\n')[0]
+ releaseregex = re.compile(r'(.*)\srelease\s(\d+).(\d*)')
+ if releaseregex.search(release):
+ family = "%s%s" % (releaseregex.search(release).group(1),
+ releaseregex.search(release).group(2))
+ if releaseregex.search(release).group(3):
+ update = releaseregex.search(release).group(3)
+ else:
+ update = 0
+ if entry.name == './etc/redhat-release':
+ release = entry.read().split('\n')[0]
+ updateregex = re.compile(r'Update\s(\d+)')
+ releaseregex = re.compile(r'release\s\d+.(\d+)')
+ if updateregex.search(release):
+ update = updateregex.search(release).group(1)
+ if releaseregex.search(release):
+ update = releaseregex.search(release).group(1)
+ cpio_object.close()
+ except rpmUtils.RpmUtilsError, e:
+ print "Warning, %s" % e
if os.path.exists("%s/.treeinfo" % paths['tree_path']):
parser = ConfigParser()
parser.read("%s/.treeinfo" % paths['tree_path'])