svn-commit-version in one step
Rafael Laboissiere
rafael at debian.org
Fri Jul 6 23:15:19 UTC 2007
* Jörg Sommer <joerg at alea.gnuu.de> [2007-07-06 15:54]:
> Tag Rafael,
>
> why do you do the release in two steps: commit the changes of changelog
> and than copy to tags. You can do this in one step.
>
> Index: utils/svn-commit-version
> ===================================================================
> --- utils/svn-commit-version (Revision 798)
> +++ utils/svn-commit-version (Arbeitskopie)
> [snip]
I am not using this script anymore. It needs a local copy of the trunk and
tags directories. I am using another one here (attached below) that is much
better and avoids the problem above.
--
Rafael
-------------- next part --------------
#!/usr/bin/perl
use Getopt::Long;
(my $prog = $0) =~ s:.*/::;
my $pkgname;
my $version;
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;
last;
}
}
close CHGLOG;
open (SVNINFO, "svn info $debdir |")
or die "$prog:E: Cannot get SVN info in directory $debdir";
my $url;
while (<SVNINFO>) {
if (/^URL: (.*)/) {
$url = $1;
last;
}
}
close SVNINFO;
$url =~ m {(.*)/debian$}
or die qq {$prog:E: URL $url does not end with "/debian"};
my $trunkurl = $1;
$trunkurl =~ m {(.*)/trunk$}
or die qq {$prog:E: URL $url does not end with "/trunk/debian"};
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 "svn ci --message=\"Debian release ${pkgname}_$version\" $debdir";
run ("svn cp $trunkurl $tagsurl/$version"
. qq { --message="Tagging Debian release ${pkgname}_$version"});
More information about the Pkg-jed-devel
mailing list