summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2012-11-19 13:56:31 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-04-03 10:10:30 +0300
commit8eed1a86a07184bf252b67326f1d2666777696d8 (patch)
treeb3ef1887488511b6b1fe0cc6b5dda59c5d5b476d
parent021b7d3688f00390da2f3d3439bc3450b2191b22 (diff)
downloadgit-buildpackage-8eed1a86a07184bf252b67326f1d2666777696d8.tar.gz
git-buildpackage-8eed1a86a07184bf252b67326f1d2666777696d8.tar.bz2
git-buildpackage-8eed1a86a07184bf252b67326f1d2666777696d8.zip
rpm: circumvent an rpm-python macro expansion problem
Parse the spec file two times to circumvent a rpm-python problem which causes macros not to be correctly expanded if used before their definition. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/rpm/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index 1d24c5c2..fd55a6d3 100644
--- a/gbp/rpm/__init__.py
+++ b/gbp/rpm/__init__.py
@@ -136,6 +136,10 @@ class SpecFile(object):
if line.split(":")[0].strip() not in skip_tags)
filtered.flush()
try:
+ # Parse two times to circumvent a rpm-python
+ # problem where macros are not expanded if used
+ # before their definition
+ rpm.spec(temp.name)
self.specinfo = rpm.spec(temp.name)
except ValueError as err:
raise GbpError("RPM error while parsing spec: %s" % err)