aboutsummaryrefslogtreecommitdiff
path: root/git-buildpackage
diff options
context:
space:
mode:
Diffstat (limited to 'git-buildpackage')
-rwxr-xr-xgit-buildpackage9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-buildpackage b/git-buildpackage
index 8ccd7c4..7ca276c 100755
--- a/git-buildpackage
+++ b/git-buildpackage
@@ -193,6 +193,8 @@ def main(argv):
help="create a tag after a successful build")
tag_group.add_option("--git-tag-only", action="store_true", dest="tag_only", default=False,
help="don't build, only tag and run the posttag hook")
+ tag_group.add_option("--git-retag", action="store_true", dest="retag", default=False,
+ help="don't fail if the tag already exists")
tag_group.add_boolean_config_file_option(option_name="sign-tags", dest="sign_tags")
tag_group.add_config_file_option(option_name="keyid", dest="keyid")
tag_group.add_config_file_option(option_name="debian-tag", dest="debian_tag")
@@ -224,6 +226,11 @@ def main(argv):
if options.verbose:
Command.verbose = True
+ if options.retag:
+ if not options.tag and not options.tag_only:
+ print >>sys.stderr, "'--%sretag' needs either '--%stag' or '--%stag-only'" % (prefix, prefix, prefix)
+ return 1
+
if options.overlay and not options.export_dir:
parser.error("Overlay must be used with --git-export-dir")
@@ -331,6 +338,8 @@ def main(argv):
if options.tag or options.tag_only:
print "Tagging %s" % version
tag = build_tag(options.debian_tag, version)
+ if options.retag and repo.has_tag(tag):
+ repo.remove_tag(tag)
GitTag(options.sign_tags, options.keyid)(tag,
msg="Debian release %s" % version)
if options.posttag: