diff options
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/config.py | 4 | ||||
-rw-r--r-- | gbp/scripts/buildpackage_rpm.py | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gbp/config.py b/gbp/config.py index 08293d34..dceb011e 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -787,6 +787,7 @@ class GbpOptionParserRpm(GbpOptionParser): 'changelog-revision': '', 'spawn-editor': 'always', 'editor-cmd': 'vim', + 'spec-vcs-tag': '', }) help = dict(GbpOptionParser.help) @@ -848,6 +849,9 @@ class GbpOptionParserRpm(GbpOptionParser): 'git-author': "Use name and email from git-config for the changelog header, " "default is '%(git-author)s'", + 'spec-vcs-tag': + "Set/update the 'VCS:' tag in the spec file, empty value " + "removes the tag entirely, default is '%(spec-vcs-tag)s'", }) def _warn_old_gbp_conf(self, gbp_conf): diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py index 85024973..16b5eb56 100644 --- a/gbp/scripts/buildpackage_rpm.py +++ b/gbp/scripts/buildpackage_rpm.py @@ -430,6 +430,7 @@ def build_parser(name, prefix=None, git_treeish=None): dest="packaging_dir") export_group.add_config_file_option(option_name="spec-file", dest="spec_file") + export_group.add_config_file_option("spec-vcs-tag", dest="spec_vcs_tag") return parser @@ -615,6 +616,10 @@ def main(argv): 'GBP_SHA1': sha})() else: vcs_info = get_vcs_info(repo, tree) + + # Put 'VCS:' tag to .spec + spec.set_tag('VCS', None, format_str(options.spec_vcs_tag, vcs_info)) + spec.write_spec_file() except KeyboardInterrupt: retval = 1 gbp.log.err("Interrupted. Aborting.") |