Search
lxdream.org :: lxdream/src/checkver.pl :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/checkver.pl
changeset 738:0cbff49086b8
next1068:a422f30ce0a8
author nkeynes
date Tue Jul 15 06:47:49 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Record the SVN revision in the build
Rationalise the version/copyright strings a little as well.
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/checkver.pl Tue Jul 15 06:47:49 2008 +0000
1.3 @@ -0,0 +1,39 @@
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 $basever = $ARGV[0];
1.9 +my $top_srcdir = $ARGV[1];
1.10 +my $outfile = $ARGV[2];
1.11 +
1.12 +my $rev = "";
1.13 +my $full_ver = "$basever";
1.14 +
1.15 +if( $svnversion ) {
1.16 + $rev = `$svnversion "$top_srcdir"`;
1.17 + chomp $rev;
1.18 + if( $rev == "exported" ) {
1.19 + $rev = "";
1.20 + } else {
1.21 + $full_ver = "${basever}.${rev}";
1.22 + }
1.23 +}
1.24 +my $header = "/* Autogenerated by checkver.pl */";
1.25 +my $output = "${header}\n".
1.26 + "const char lxdream_package_name[] = \"lxdream $basever\";\n" .
1.27 + "const char lxdream_short_version[] = \"$basever\";\n" .
1.28 + "const char lxdream_full_version[] = \"$full_ver\";\n" .
1.29 + "const char lxdream_copyright[] = \"Copyright (C) 2005-2008 Nathan Keynes\";\n";
1.30 +
1.31 +my $oldfile = "";
1.32 +if( -e $outfile ) {
1.33 + open(VERSIONFILE, "<$outfile") || die "Unable to read from $outfile\n";
1.34 + $oldfile = join "", <VERSIONFILE>;
1.35 + close(VERSIONFILE);
1.36 +}
1.37 +
1.38 +if( $oldfile ne $output ) {
1.39 + open(VERSIONFILE, ">$outfile") || die "Unable to write to $outfile\n";
1.40 + print VERSIONFILE $output;
1.41 + close(VERSIONFILE);
1.42 +}
1.43 \ No newline at end of file
.