From: Markus Lehtonen Date: Thu, 3 Jan 2013 14:03:23 +0000 (+0200) Subject: rpm helpers: parse 'nosource' and 'nopatch' sources correctly X-Git-Tag: debian/0.6.25~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e48816d3a3e175b64aca5dcc168739847f44cbe5;p=tools%2Fgit-buildpackage.git rpm helpers: parse 'nosource' and 'nopatch' sources correctly Signed-off-by: Markus Lehtonen --- diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py index 1453f24..b179605 100644 --- a/gbp/rpm/__init__.py +++ b/gbp/rpm/__init__.py @@ -415,7 +415,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'],\ @@ -431,7 +431,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: diff --git a/tests/test_rpm_data/specs/gbp-test-updates-reference.spec b/tests/test_rpm_data/specs/gbp-test-updates-reference.spec index e6e6846..eae2739 100644 --- a/tests/test_rpm_data/specs/gbp-test-updates-reference.spec +++ b/tests/test_rpm_data/specs/gbp-test-updates-reference.spec @@ -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 diff --git a/tests/test_rpm_data/specs/gbp-test-updates.spec b/tests/test_rpm_data/specs/gbp-test-updates.spec index 1991244..0bc1571 100644 --- a/tests/test_rpm_data/specs/gbp-test-updates.spec +++ b/tests/test_rpm_data/specs/gbp-test-updates.spec @@ -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