From d09ff463d3461ca55e3c1f8b439d6699ae449763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Tue, 31 May 2016 03:24:32 +0200 Subject: adapt to removal of rpm_macros_defs() --- MgaRepo/log.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'MgaRepo') 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) -- cgit v1.2.1