summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-02-25 12:11:14 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-11-14 14:46:23 +0200
commitef44e8eaa2b7d75c5535e6b67d8d8a6e9307a376 (patch)
tree626b943de25c452869e6dd5799704fa6ee83274e
parent13ceef51e8fe07831a93851a885a34856f858f70 (diff)
downloadgit-buildpackage-ef44e8eaa2b7d75c5535e6b67d8d8a6e9307a376.tar.gz
git-buildpackage-ef44e8eaa2b7d75c5535e6b67d8d8a6e9307a376.tar.bz2
git-buildpackage-ef44e8eaa2b7d75c5535e6b67d8d8a6e9307a376.zip
rpm: support conditionals in patch-export
One can now define conditional patches that are enclosed in '%if' or '%ifarch' when the spec file is updated. One can do this by defining 'Gbp-Rpm-If: <conditional>' and 'Gbp-Rpm-IfArch: <conditional>' in the commit message. Only one conditional per patch is supported, i.e. you cannot define 'IfArch' and 'If' for the same patch. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/pq_rpm.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py
index d3da13a8..edb327f6 100755
--- a/gbp/scripts/pq_rpm.py
+++ b/gbp/scripts/pq_rpm.py
@@ -110,7 +110,8 @@ def generate_patches(repo, start, squash, end, outdir, options):
# Generate patches
for commit in reversed(repo.get_commits(start, end_commit)):
info = repo.get_commit_info(commit)
- cmds = parse_gbp_commands(info, 'gbp-rpm', ('ignore'), None)[0]
+ cmds = parse_gbp_commands(info, 'gbp-rpm', ('ignore'),
+ ('if', 'ifarch'))[0]
if not 'ignore' in cmds:
patch_fn = format_patch(outdir, repo, info, patches,
options.patch_numbers,
@@ -164,9 +165,9 @@ def update_patch_series(repo, spec, start, end, options):
# Unlink old patch files and generate new patches
rm_patch_files(spec)
- patches, _commands = generate_patches(repo, start, squash, end,
- spec.specdir, options)
- spec.update_patches(patches)
+ patches, commands = generate_patches(repo, start, squash, end,
+ spec.specdir, options)
+ spec.update_patches(patches, commands)
spec.write_spec_file()