aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-10-04 21:35:14 +0000
committerPascal Terjan <pterjan@mageia.org>2018-10-04 21:35:14 +0000
commitaea06b5322692608d94670d809e4244ce68ed7a5 (patch)
treec205348e3b8f94cebeba1eed4923816749361f0c
parent977341d4a99ea2870deba861adbe2d0e3318174d (diff)
downloadmgarepo-aea06b5322692608d94670d809e4244ce68ed7a5.tar
mgarepo-aea06b5322692608d94670d809e4244ce68ed7a5.tar.gz
mgarepo-aea06b5322692608d94670d809e4244ce68ed7a5.tar.bz2
mgarepo-aea06b5322692608d94670d809e4244ce68ed7a5.tar.xz
mgarepo-aea06b5322692608d94670d809e4244ce68ed7a5.zip
Define _topdir in getrelease
This is required for specfiles using files from SOURCES with %load
-rw-r--r--MgaRepo/log.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/MgaRepo/log.py b/MgaRepo/log.py
index ac76b1e..ab7695a 100644
--- a/MgaRepo/log.py
+++ b/MgaRepo/log.py
@@ -30,23 +30,22 @@ def getrelease(pkgdirurl, rev=None, macros=[], exported=None, create=False):
from MgaRepo.rpmutil import rpm_macros_defs
svn = SVN()
pkgcurrenturl = os.path.join(pkgdirurl, "current")
- specurl = os.path.join(pkgcurrenturl, "SPECS")
- srpmurl = os.path.join(pkgcurrenturl, "SRPMS")
if not create:
if exported is None:
tmpdir = tempfile.mktemp()
- svn.export(specurl, tmpdir, rev=rev)
+ svn.export(pkgcurrenturl, tmpdir, rev=rev)
+ topdir = tmpdir
else:
- tmpdir = os.path.join(exported, "SPECS")
+ topdir = exported
try:
- found = glob.glob(os.path.join(tmpdir, "*.spec"))
+ found = glob.glob(os.path.join(topdir, "SPECS", "*.spec"))
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))
+ "--specfile %s %s --define '_topdir %s'") %
+ (specpath, options, topdir))
pipe = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True)
pipe.wait()
@@ -73,18 +72,19 @@ def getrelease(pkgdirurl, rev=None, macros=[], exported=None, create=False):
else:
if exported is None:
tmpdir = tempfile.mktemp()
- svn.export(specurl, tmpdir, rev=rev)
+ svn.export(pkgcurrenturl, tmpdir, rev=rev)
+ topdir = tmpdir
else:
- tmpdir = os.path.join(exported, "SRPMS")
+ topdir = exported
try:
- found = glob.glob(os.path.join(srpmurl, "*.src.rpm"))
+ found = glob.glob(os.path.join(topdir, "SRPMS", "*.src.rpm"))
if not found:
raise Error("no .src.rpm file found inside %s" % srpmurl)
srpmpath = found[0]
options = rpm_macros_defs(macros)
command = (("rpm -qp --qf '%%{EPOCH}:%%{VERSION}-%%{RELEASE}\n' "
- " %s %s") %
- (srpmpath, options))
+ " %s %s --define '_topdir %s'") %
+ (srpmpath, options, topdir))
pipe = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True)
pipe.wait()