From: Markus Lehtonen Date: Wed, 21 Nov 2012 10:51:53 +0000 (+0200) Subject: rpm: rename the 'GbpIgnorePatch' special key in spec parsing X-Git-Tag: tizen/0.6.15-20140828~123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5010e367f9ef63c9bb627109287d593f4c1f9b8e;p=tools%2Fgit-buildpackage.git rpm: rename the 'GbpIgnorePatch' special key in spec parsing to 'Gbp-Ignore-Patches' for better readability. All the special keys (or "gbp-tags") now have to start with the "Gbp-" prefix. Signed-off-by: Markus Lehtonen --- diff --git a/gbp/rpm/__init__.py b/gbp/rpm/__init__.py index ad6c96de..91b270cf 100644 --- a/gbp/rpm/__init__.py +++ b/gbp/rpm/__init__.py @@ -125,7 +125,7 @@ class SpecFile(object): '(?P\S(.*\S)?)\s*$', flags=re.I) macro_re = re.compile(r'^%(?P[a-z]+)(?P[0-9]+)?' '(\s+(?P.*))?$') - gbptag_re = re.compile(r'^\s*#\s*gbp(?P[a-z-]+)' + gbptag_re = re.compile(r'^\s*#\s*gbp-(?P[a-z-]+)' '(\s*:\s*(?P\S.*))?$', flags=re.I) def __init__(self, specfile, skip_tags=("ExcludeArch", "ExcludeOS", @@ -270,7 +270,7 @@ class SpecFile(object): line = str(lineobj) m = self.gbptag_re.match(line) if m: - if m.group('name').lower() == 'ignorepatch': + if m.group('name').lower() == 'ignore-patches': dataitems = m.group('args').strip().split() ignorepatch = sorted([int(num) for num in dataitems]) else: diff --git a/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec index 8a07d662..c46a734e 100644 --- a/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test.spec @@ -7,7 +7,7 @@ License: GPLv2 Source: %{name}-%{version}.tar.bz2 Source1: foo.txt Source20: bar.tar.gz -# GbpIgnorePatch: 0 +# Gbp-Ignore-Patches: 0 Patch0: my.patch Patch10: my2.patch Patch20: my3.patch diff --git a/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec index 932b8e8f..d5a228fd 100644 --- a/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec +++ b/tests/test_rpm_data/rpmbuild/SPECS/gbp-test2.spec @@ -8,7 +8,7 @@ License: GPLv2 Source10: ftp://ftp.host.com/%{name}-%{version}.tar.gz Source: foo.txt Source20: bar.tar.gz -# GbpIgnorePatch: 0 +# Gbp-Ignore-Patches: 0 Patch: my.patch Patch10: my2.patch Patch20: my3.patch diff --git a/tests/test_rpm_data/specs/gbp-test-reference.spec b/tests/test_rpm_data/specs/gbp-test-reference.spec index 884a64ca..050d1398 100644 --- a/tests/test_rpm_data/specs/gbp-test-reference.spec +++ b/tests/test_rpm_data/specs/gbp-test-reference.spec @@ -7,7 +7,7 @@ License: GPLv2 Source: %{name}-%{version}.tar.bz2 Source1: foo.txt Source20: bar.tar.gz -# GbpIgnorePatch: 0 +# Gbp-Ignore-Patches: 0 Patch0: my.patch # Patches auto-generated by git-buildpackage: Patch1: new.patch