[Pkg-haskell-commits] [DHG_packages] 01/01: New script: what-to-build.pl

Joachim Breitner nomeata at moszumanska.debian.org
Mon Jul 13 17:06:04 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 becb5a23607e5a3396b548a1eb9f616452a1cb93
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Jul 13 19:05:38 2015 +0200

    New script: what-to-build.pl
    
    This shows a few untagged repositories...
---
 README.md        | 14 ++++++++++++--
 what-to-build.pl | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 0107d88..67c950e 100644
--- a/README.md
+++ b/README.md
@@ -62,8 +62,18 @@ the Debian source package name:
 In the full debian version, `:` and `~` are replaced by `_`.
 
 
-Useful tools
-------------
+Scripts in this repository
+--------------------------
+
+ * `./what-to-build.pl`.
+
+   This script expects to be run with any number of directories as arguments,
+   and defaults to `p/*/`. It prints the name of those directories that contain a
+   package that is to be released (i.e. marked for upload, but not yet tagged).
+
+
+Useful general tools
+--------------------
 
  * `origtargz`:
 
diff --git a/what-to-build.pl b/what-to-build.pl
new file mode 100755
index 0000000..4c63cba
--- /dev/null
+++ b/what-to-build.pl
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+my @dirs = @ARGV;
+
+unless (@dirs) {
+	@dirs = glob 'p/*/';
+}
+
+my @to_build;
+
+my %tags;
+open TAGS, '-|', 'git tag -l' or die @!;
+while (<TAGS>) { chomp; $tags{$_}++ };
+close TAGS or die @!;
+
+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;
+		next if ($suite eq "UNRELEASED");
+		next if ($tags{$tag});
+		printf "%s\n", $dir;
+	} 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