summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-05 15:07:54 +0200
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2014-02-07 14:25:26 +0200
commit4188efd97f798bc4a32c34b3791388fba59b13cf (patch)
tree97880c7f37a8737598e6640b07c05c5d3bcc62f4
parenteb31b7d8ab32f147d8af213cb67cb3fbd78a4a42 (diff)
downloadgit-buildpackage-4188efd97f798bc4a32c34b3791388fba59b13cf.tar.gz
git-buildpackage-4188efd97f798bc4a32c34b3791388fba59b13cf.tar.bz2
git-buildpackage-4188efd97f798bc4a32c34b3791388fba59b13cf.zip
buildpackage-rpm: function for creating packaging tag
Implement a function for creating the packaging tag in the Git repository. In order to re-use the functionality elsewhere. Change-Id: I0b475b541b2bda0df4f5e99b989aa369cc05d7aa Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
-rwxr-xr-xgbp/scripts/buildpackage_rpm.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py
index 30ea5783..1b619e23 100755
--- a/gbp/scripts/buildpackage_rpm.py
+++ b/gbp/scripts/buildpackage_rpm.py
@@ -309,6 +309,13 @@ def packaging_tag_name(repo, spec, commit_info, options):
commit_info)
return repo.version_to_tag(options.packaging_tag, tag_str_fields)
+def create_packaging_tag(repo, tag, commit, version, options):
+ """Create a packaging/release Git tag"""
+ msg = "%s release %s" % (options.vendor,
+ RpmPkgPolicy.compose_full_version(version))
+ repo.create_tag(name=tag, msg=msg, sign=options.sign_tags,
+ keyid=options.keyid, commit=commit)
+
def disable_hooks(options):
"""Disable all hooks (except for builder)"""
for hook in ['cleaner', 'postexport', 'prebuild', 'postbuild', 'posttag']:
@@ -603,9 +610,8 @@ def main(argv):
tag = packaging_tag_name(repo, spec, commit_info, options)
if options.retag and repo.has_tag(tag):
repo.delete_tag(tag)
- repo.create_tag(name=tag, msg="%s release %s" % (options.vendor,
- RpmPkgPolicy.compose_full_version(spec.version)),
- sign=options.sign_tags, keyid=options.keyid, commit=tree)
+ create_packaging_tag(repo, tag, commit=tree, version=spec.version,
+ options=options)
tree_name = tag
commit_sha1 = repo.rev_parse('%s^0' % tag)
if options.posttag: