aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo/log.py
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-31 03:24:32 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-05-31 03:24:32 +0200
commitd09ff463d3461ca55e3c1f8b439d6699ae449763 (patch)
treeef5bcc7d1a5c884b9d094f34176881d82d781cf2 /MgaRepo/log.py
parentf9142e00b3078e8583661dc94258e02276f18fa9 (diff)
downloadmgarepo-d09ff463d3461ca55e3c1f8b439d6699ae449763.tar
mgarepo-d09ff463d3461ca55e3c1f8b439d6699ae449763.tar.gz
mgarepo-d09ff463d3461ca55e3c1f8b439d6699ae449763.tar.bz2
mgarepo-d09ff463d3461ca55e3c1f8b439d6699ae449763.tar.xz
mgarepo-d09ff463d3461ca55e3c1f8b439d6699ae449763.zip
adapt to removal of rpm_macros_defs()
Diffstat (limited to 'MgaRepo/log.py')
-rw-r--r--MgaRepo/log.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/MgaRepo/log.py b/MgaRepo/log.py
index e02547f..25de1b7 100644
--- a/MgaRepo/log.py
+++ b/MgaRepo/log.py
@@ -26,7 +26,6 @@ def getrelease(pkgdirurl, rev=None, macros=[], exported=None):
Is here where things should be changed if "automatic release increasing"
will be used.
"""
- from MgaRepo.rpmutil import rpm_macros_defs
svn = SVN()
pkgcurrenturl = os.path.join(pkgdirurl, "current")
specurl = os.path.join(pkgcurrenturl, "SPECS")
@@ -40,11 +39,11 @@ def getrelease(pkgdirurl, rev=None, macros=[], exported=None):
if not found:
raise Error("no .spec file found inside %s" % specurl)
specpath = found[0]
- options = rpm_macros_defs(macros)
- command = (("rpm -q --qf '%%{EPOCH}:%%{VERSION}-%%{RELEASE}\n' "
- "--specfile %s %s") %
- (specpath, options))
- output = get_output_exec(command)
+ options = [("--define", expr) for expr in macros]
+ command = ["rpm", "-q", "--qf", "%{EPOCH}:%{VERSION}-%{RELEASE}\n",
+ "--specfile", specpath]
+ command.extend(options)
+ status, output = execcmd(*command)
releases = output.split()
try:
epoch, vr = releases[0].split(":", 1)