From 8289192f1e8907303b2a36531043909fcdab48f0 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Tue, 7 Jan 2014 16:00:36 +0100 Subject: [PATCH] Packages: Created debian/tag-release script to easily tag new versions. --- debian/tag-release | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 debian/tag-release diff --git a/debian/tag-release b/debian/tag-release new file mode 100755 index 00000000..5869f83c --- /dev/null +++ b/debian/tag-release @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w +use strict; + +my $help = $ARGV[0]; +if (defined($help) && $help eq "--help") { + print <. + +If no is given, a version number is computed by incrementing the last +number in the sequence, e.g. after 5.0 goes 5.1, etc. + +Options: +-n show the version, do not create any tags + +EOF + exit 0; +} + +my $dry = $ARGV[0]; +if (defined($dry) && $dry eq "-n") { + shift @ARGV; +} else { + undef $dry; +} + +my $vv = $ARGV[0]; + +my $v = `git describe`; +chomp $v; +$v =~ s/^v// or die; +$v =~ s/-.*//; +print "Old version: $v\n"; + +unless ($vv) { + my @c = split /\./, $v; + if (@c == 2) { push @c, 1; } else { $c[$#c]++; } + $vv = join(".", @c); +} + +print "New version: $vv\n"; +print "Not tagging, running with -n.\n" and exit 0 if $dry; +`git tag -a -m "Releasing version $vv" v$vv`; +die if $?; +print "Tagged. Do not forget to push with tags.\n"; -- 2.39.2