[Pkg-octave-commit] r2387 - utils

Thomas Weber thomas-guest at alioth.debian.org
Sat Aug 23 10:58:21 UTC 2008


Author: thomas-guest
Date: 2008-08-23 10:58:21 +0000 (Sat, 23 Aug 2008)
New Revision: 2387

Added:
   utils/svn-deb-release
Log:
Add helper script for tagging release
(so I don't have to search through my mails for finding it :) )


Added: utils/svn-deb-release
===================================================================
--- utils/svn-deb-release	                        (rev 0)
+++ utils/svn-deb-release	2008-08-23 10:58:21 UTC (rev 2387)
@@ -0,0 +1,87 @@
+#!/usr/bin/perl
+
+### $Id$
+
+use Getopt::Long;
+
+(my $prog = $0) =~ s:.*/::;
+
+my $pkgname;
+my $version;
+my $isnative;
+my $dry_run = 0;
+
+GetOptions ("dry-run"  => \$dry_run,
+            "help" => \$help);
+
+if ($help) {
+  print "FIXME\n";
+  exit 0;
+}
+
+die "Usage: $prog [build-dir]\n"
+  if $#ARGV > 1;
+
+my $buildir = $#ARGV == 0 ? $ARGV [0] : ".";
+
+my $debdir = "$buildir/debian";
+
+die "$prog:E: Directory $debdir does not exist"
+  if not -d $debdir;
+
+open (CHGLOG, "< $debdir/changelog")
+  or die "$prog:E: Cannot open $debdir/changelog";
+
+while (<CHGLOG>) {
+  if (/^(\S+) \(([^)]+)\)/) {
+    $pkgname = $1
+      if not defined $pkgname;
+    $version = $2;
+    $isnative = not ($version =~ /-/);
+    last;
+  }
+}
+
+close CHGLOG;
+
+my $commitdir = $isnative ? "." : "debian";
+
+open (SVNINFO, "svn info $commitdir |")
+  or die "$prog:E: Cannot get SVN info in directory $commitdir";
+
+my $url;
+
+while (<SVNINFO>) {
+  if (/^URL: (.*)/) {
+    $url = $1;
+    last;
+  }
+}
+
+close SVNINFO;
+
+$isnative or $url =~ m {(.*)/debian$}
+  or die qq {$prog:E: URL $url does not end with "/debian"};
+
+my $trunkurl = $url;
+
+$trunkurl =~ m {(.*)/trunk}
+  or die qq {$prog:E: URL $url does not contain with "/trunk"};
+
+my $baseurl = $1;
+
+my $tagsurl = "$baseurl/tags";
+
+sub run {
+  my $cmd = shift;
+  print "\n$cmd\n";
+  system $cmd if not $dry_run;
+}
+
+system ("svn list $tagsurl 2>&1 > /dev/null") == 0
+  or run qq {svn mkdir $tagsurl --message="Created tags dir"};
+
+run qq {svn ci --message="Debian release ${pkgname}_$version" $commitdir};
+
+run ("svn cp $trunkurl $tagsurl/$version"
+     . qq { --message="Tag Debian release ${pkgname}_$version"});


Property changes on: utils/svn-deb-release
___________________________________________________________________
Name: svn:executable
   + *
Name: keywords
   + Id





More information about the Pkg-octave-commit mailing list