summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-24 08:58:18 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-24 09:06:43 +0200
commit27579ee44f0492e9d3d63d238640a3ba2fe77c96 (patch)
treead8eab6fb5bc11b3b3c6cbd0443bf5c4955641c1
parenta0247368627d15f1f2a8f67bddc02d1351ecf2f8 (diff)
downloadgit-buildpackage-27579ee44f0492e9d3d63d238640a3ba2fe77c96.tar.gz
git-buildpackage-27579ee44f0492e9d3d63d238640a3ba2fe77c96.tar.bz2
git-buildpackage-27579ee44f0492e9d3d63d238640a3ba2fe77c96.zip
rpm: correctly handle 'NoSource' and 'NoPatch' tags in spec
NoSource and NoPatch should be lists, thus not currently fully supported by us. However, rpm-python used to return them as long values in case only one NoSource/NoPatch tag was defined (RH Bug: 991329). Change-Id: Id99205a68f2c8862a4d9fa141c4507a287a90a6b Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rw-r--r--gbp/rpm/__init__.py7
-rw-r--r--tests/test_rpm.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py
index c79ddf6b..0b1e6df5 100644
--- a/gbp/rpm/__init__.py
+++ b/gbp/rpm/__init__.py
@@ -153,7 +153,8 @@ class SpecFile(object):
'provides', 'obsoletes', 'buildrequires',
'buildconflicts', 'buildrecommends',
'buildsuggests', 'buildsupplements',
- 'buildenhances', 'collections')
+ 'buildenhances', 'collections',
+ 'nosource', 'nopatch')
self._specinfo = self._parse_filtered_spec(self._filtertags)
# Other initializations
@@ -312,8 +313,8 @@ class SpecFile(object):
tagvalue = None
elif not tagvalue:
# Rpm python doesn't give the following, for reason or another
- if tagname not in ('buildroot', 'nopatch', 'nosource', 'autoprov',
- 'autoreq', 'autoreqprov') + self._filtertags:
+ if tagname not in ('buildroot', 'autoprov', 'autoreq',
+ 'autoreqprov') + self._filtertags:
gbp.log.warn("BUG: '%s:' tag not found by rpm" % tagname)
tagvalue = matchobj.group('value')
linerecord = {'line': lineobj,
diff --git a/tests/test_rpm.py b/tests/test_rpm.py
index 3e3a599e..13799266 100644
--- a/tests/test_rpm.py
+++ b/tests/test_rpm.py
@@ -293,7 +293,7 @@ class TestSpecFile(object):
# Check all the tags
for name, val in spec.protected('_tags').iteritems():
rval = None
- if name in ('version', 'release', 'epoch', 'nosource', 'nopatch'):
+ if name in ('version', 'release', 'epoch'):
rval = '0'
elif name in ('autoreq', 'autoprov', 'autoreqprov'):
rval = 'No'