rpm helpers: parse 'nosource' and 'nopatch' sources correctly
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 3 Jan 2013 14:03:23 +0000 (16:03 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 7 Jan 2014 14:21:30 +0000 (16:21 +0200)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
gbp/rpm/__init__.py
tests/test_rpm_data/specs/gbp-test-updates-reference.spec
tests/test_rpm_data/specs/gbp-test-updates.spec

index ed0d662c1581c71a068f5bff9d609f7ff382642e..6e1d4ff20cc9b75fe244382c55f597d05c626412 100644 (file)
@@ -414,7 +414,7 @@ class SpecFile(object):
             # workaround rpm parsing bug
             if num >= MAX_SOURCE_NUMBER:
                 num = 0
-            if typ == 1:
+            if typ == 1 or typ == 9:
                 if num in self.sources:
                     self.sources[num]['filename'] = os.path.basename(name)
                     self.sources[num]['filename_base'],\
@@ -430,7 +430,7 @@ class SpecFile(object):
                             self.sources[num]['prefix'] = self.sources[num]['filename_base'] + "/"
                 else:
                     gbp.log.err("BUG: we didn't correctly parse all 'Source' tags!")
-            if typ == 2:
+            if typ == 2 or typ == 10:
                 if num in self.patches:
                     self.patches[num]['filename'] = name
                 else:
index e6e6846cefe3d1c5135483fdd22510703380098a..eae2739a9bd0c6a04ad4c51e7802ba8556c16503 100644 (file)
@@ -15,6 +15,8 @@ Group:          my_group
 Packager:       my_packager
 Url:            my_url
 Vcs:            my_vcs
+Nosource:       0
+Nopatch:        1
 BuildRoot:      my_buildroot
 Provides:       my_provides
 Requires:       my_requires
index 199124426f2045f2358389a20888fd938a92e864..0bc157122b257f73066eef344c94381eee2631ac 100644 (file)
@@ -19,6 +19,8 @@ Vcs:            my_vcs
 Source:         my_source
 Patch:          my_%patch_fn_base
 Patch1:         my_%{patch_fn_base}1
+Nosource:       0
+Nopatch:        1
 BuildRoot:      my_buildroot
 Provides:       my_provides
 Requires:       my_requires