Search
lxdream.org :: lxdream :: r1068:a422f30ce0a8
lxdream 0.9.1
released Jun 29
Download Now
changeset1068:a422f30ce0a8
parent1067:d3c00ffccfcd
child1069:7e2b65496762
authornkeynes
dateMon Jul 06 08:15:20 2009 +1000 (10 years ago)
Update checkver.pl to retrieve the mercurial revision and hash
src/checkver.pl
1.1 --- a/src/checkver.pl Sun Jul 05 13:54:48 2009 +1000
1.2 +++ b/src/checkver.pl Mon Jul 06 08:15:20 2009 +1000
1.3 @@ -1,21 +1,21 @@
1.4 #!/usr/bin/perl
1.5 # Usage: updatever.pl <basever> <top_srcdir> <version file>
1.6
1.7 -my $svnversion = "svnversion";
1.8 +my $hgversion = "hg identify -i -n";
1.9 my $basever = $ARGV[0];
1.10 my $top_srcdir = $ARGV[1];
1.11 my $outfile = $ARGV[2];
1.12
1.13 -my $rev = "";
1.14 +my $rev = "", $hash;
1.15 my $full_ver = "$basever";
1.16
1.17 -if( $svnversion ) {
1.18 - $rev = `$svnversion "$top_srcdir"`;
1.19 - chomp $rev;
1.20 - if( $rev == "exported" ) {
1.21 - $rev = "";
1.22 - } else {
1.23 - $full_ver = "${basever}.${rev}";
1.24 +if( $hgversion ) {
1.25 + my $ident = `$hgversion "$top_srcdir" 2>/dev/null`;
1.26 + if ( $? == 0 ) {
1.27 + chomp $ident;
1.28 + ($hash,$rev) = split /\s+/,$ident,2;
1.29 + $rev =~ s/\+//g;
1.30 + $full_ver = "${basever}.${rev}:${hash}";
1.31 }
1.32 }
1.33 my $header = "/* Autogenerated by checkver.pl */";
.