summaryrefslogtreecommitdiffhomepage
path: root/tests/20_test_rpm.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-12-16 11:39:46 +0200
committerGuido Günther <agx@sigxcpu.org>2017-12-16 15:11:44 +0100
commitd9a5319ae466f71397a265df10704a37104cbdec (patch)
tree1fc812075cd1f758847e6f469d31ce160c22e77f /tests/20_test_rpm.py
parent5aaec4ffa9f77537a17fc00d9892680015a1f90b (diff)
rpm.SpecFile: support %autosetup
Try to do "the right thing" when %autosetup macro is used in the spec file. That is, do not examine/manage %patch macros at all, but, assume that patches are handled by %autosetup which was introduced in RPM v4.11. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'tests/20_test_rpm.py')
-rw-r--r--tests/20_test_rpm.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/20_test_rpm.py b/tests/20_test_rpm.py
index d42d68bc..a2cd5e01 100644
--- a/tests/20_test_rpm.py
+++ b/tests/20_test_rpm.py
@@ -334,6 +334,18 @@ class TestSpecFile(RpmTestBase):
eq_(len(series), 2)
eq_(os.path.basename(series[-1].path), '1.patch')
+ def test_patch_series_autosetup(self):
+ """Check patch series functionalitu with %autostup"""
+ spec_filepath = os.path.join(SPEC_DIR, 'gbp-test3.spec')
+ spec = SpecFileTester(spec_filepath)
+
+ eq_(len(spec.patchseries()), 2)
+ eq_(len(spec.patchseries(ignored=True)), 3)
+ spec.update_patches(['1.patch'], {})
+ eq_(len(spec.patchseries()), 1)
+ eq_(len(spec.patchseries(ignored=True)), 2)
+ eq_(spec.protected('_special_directives')['patch'], [])
+
def test_patch_series_quirks(self):
"""Patches are applied in order different from the patch numbering"""
spec_filepath = os.path.join(SPEC_DIR, 'gbp-test-quirks.spec')