[Pkg-octave-commit] rev 265 - in trunk: . utils

Rafael Laboissiere rafael at costa.debian.org
Fri Sep 23 22:59:43 UTC 2005


Author: rafael
Date: 2005-09-23 22:59:42 +0000 (Fri, 23 Sep 2005)
New Revision: 265

Added:
   trunk/utils/
   trunk/utils/svn-commit-version
Log:
Added script for automating the commit and tag of a new Debian release.
This is inchoate, albeit working, but needs documentation and on-line help.


Added: trunk/utils/svn-commit-version
===================================================================
--- trunk/utils/svn-commit-version	2005-09-23 22:11:21 UTC (rev 264)
+++ trunk/utils/svn-commit-version	2005-09-23 22:59:42 UTC (rev 265)
@@ -0,0 +1,73 @@
+#!/usr/bin/perl
+
+use Getopt::Long;
+
+(my $prog = $0) =~ s:.*/::;
+
+my $pkgname;
+my $version;
+my $dry_run = 0;
+
+GetOptions ("package=s" => \$pkgname,
+            "dry-run"  => \$dry_run,
+            "help" => \$help);
+
+if ($help) {
+  print "FIXME\n";
+  exit 0;
+}
+
+print "Usage: $prog [options] svn-dir [build-dir]\n"
+  if $#ARGV < 0 or $#ARGV > 1;
+
+my $svndir = $ARGV [0];
+
+my $trunkdir = "$svndir/trunk/packages";
+die "Trunk directory $trunkdir does not exist"
+  if not -d $trunkdir;
+
+my $tagsdir = "$svndir/tags/packages";
+die "Tags directory $tagsdir does not exist"
+  if not -d $tagsdir;
+
+my $buildir = $#ARGV == 1 ? $ARGV [1] : ".";
+
+sub run {
+  my $cmd = shift;
+  if ($dry_run) {
+    print "$cmd\n";
+  } else {
+    system $cmd;
+  }
+}
+
+my $debdir = "$buildir/debian";
+
+die "Directory $debdir does not exist"
+  if not -d $debdir;
+
+open (CHGLOG, "< $debdir/changelog")
+  or die "Cannot open $debdir/changelog";
+
+while (<CHGLOG>) {
+  if (/^(\S+) \(([^)]+)\)/) {
+    $pkgname = $1
+      if not defined $pkgname;
+    $version = $2;
+    last;
+  }
+}
+
+run "svn ci --message=\"Debian release $version\" $debdir";
+
+die "Directory $trunkdir/$pkgname does not exist"
+  if not -d "$trunkdir/$pkgname";
+run "svn up $trunkdir/$pkgname";
+
+die "Directory $tagskdir/$pkgname does not exist"
+  if not -d "$tagsdir/$pkgname";
+run "svn cp $trunkdir/$pkgname $tagsdir/$pkgname/$version";
+
+run ("svn ci --message=\"Tagging Debian release $version\" "
+     . "$tagsdir/$pkgname/$version");
+


Property changes on: trunk/utils/svn-commit-version
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-octave-commit mailing list