From: Pavel Charvat Date: Tue, 7 Jan 2014 15:00:36 +0000 (+0100) Subject: Packages: Created debian/tag-release script to easily tag new versions. X-Git-Tag: v5.99~41 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8289192f1e8907303b2a36531043909fcdab48f0;p=libucw.git Packages: Created debian/tag-release script to easily tag new versions. --- 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";