diff options
author | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-05-08 19:00:31 +0000 |
---|---|---|
committer | Bogdano Arendartchuk <bogdano@mandriva.org> | 2007-05-08 19:00:31 +0000 |
commit | eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4 (patch) | |
tree | 8e9b47fc08914506e5047aab367c90263d72becb | |
parent | 1e082d77b7d44682d6a41c5cf53cc0b132fb5765 (diff) | |
download | mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.gz mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.bz2 mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.tar.xz mgarepo-eecca989feb2fd9ca8edff1a26c2f8ac6e7c54f4.zip |
Show epoch of the release in changelog, even when it has not been
markreleased yet.
-rw-r--r-- | RepSys/log.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/RepSys/log.py b/RepSys/log.py index 785214e..138918f 100644 --- a/RepSys/log.py +++ b/RepSys/log.py @@ -65,7 +65,7 @@ def getrelease(pkgdirurl, rev=None, macros=[]): if found: specpath = found[0] options = rpm_macros_defs(macros) - command = (("rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' " + command = (("rpm -q --qf '%%{EPOCH}:%%{VERSION}-%%{RELEASE}\n' " "--specfile %s %s 2>/dev/null") % (specpath, options)) status, output = execcmd(command) @@ -73,11 +73,17 @@ def getrelease(pkgdirurl, rev=None, macros=[]): raise Error, "Error in command %s: %s" % (command, output) releases = output.split() try: - version, release = releases[0].split("-", 1) + epoch, vr = releases[0].split(":", 1) + version, release = vr.split("-", 1) except ValueError: raise Error, "Invalid command output: %s: %s" % \ (command, output) - return version, release + #XXX check if this is the right way: + if epoch == "(none)": + ev = version + else: + ev = epoch + ":" + version + return ev, release finally: if os.path.isdir(tmpdir): shutil.rmtree(tmpdir) |