[Pkg-haskell-commits] [DHG_packages] 01/01: Rudimentary tag script

Joachim Breitner nomeata at moszumanska.debian.org
Mon Jul 13 19:16:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

nomeata pushed a commit to branch master
in repository DHG_packages.

commit 683ce9091ed4c20b1ed4c661d853e83170827f53
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Jul 13 21:15:37 2015 +0200

    Rudimentary tag script
---
 tag.pl | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/tag.pl b/tag.pl
new file mode 100755
index 0000000..ae22f96
--- /dev/null
+++ b/tag.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+
+# TODO:
+#  * Check for uncommited changes before
+
+use strict;
+use warnings;
+
+my @dirs = @ARGV;
+
+unless (@dirs) {
+	@dirs = glob 'p/*/';
+}
+
+my @to_build;
+
+for my $dir (@dirs) {
+	my $changelog = "$dir/debian/changelog";
+	next unless -r $changelog;
+	open CHANGELOG, '<', $changelog or die @!;
+	my $firstline = <CHANGELOG>;
+	if ($firstline =~ m/([\w-]+) \(([\w:~.+-]+)\) (\w+);/) {
+		my ($source, $version, $suite) = ($1, $2, $3);
+		my $tag = sprintf "%s_v%s", $source, $version;
+		my $msg = sprintf "Tagging %s version %s, targetted for %s", $source, $version, $suite;
+		if ($suite eq "UNRELEASED") {
+			printf STDERR "Cannot tag UNRELEASED package %s-%s", $source, $version;
+		} else {
+			my $ret = system(qw/git tag -a -m/, $msg, $tag);
+			die (sprintf "Failed to tag %s: %d\n", $tag, $?>>8) if $ret != 0;
+			printf "Added tag %s\n", $tag;
+		}
+	} else {
+		printf STDERR "Cannot parse %s:\n%s", $changelog, $firstline;
+		next
+	}
+}
+
+
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git



More information about the Pkg-haskell-commits mailing list