handle test.cfg, it shouldn't be a tracked file, and ignore it
[bse.git] / site / util / bse_mksvnversion.pl
1 #!perl -w
2 use strict;
3
4 my $release = shift;
5
6 my $output = shift
7   or die "Usage: $0 <bserev> <outfile>\n";
8
9 $release =~ /^\d+\.\d+(_\d+)?$/
10   or die "Invalid revision";
11
12 my ($svn_rev_line) = grep /^Revision/, `svn info`;
13 $svn_rev_line =~ /(\d+)/
14   or die "Invalid svn revision";
15 my $svn_rev = $1;
16
17 open VERSION, "> $output"
18   or die "Cannot create $output: $!\n";
19 print VERSION <<EOS;
20 package BSE::Version;
21 use strict;
22
23 my \$VERSION = "$release SVN r$svn_rev";
24
25 sub version { \$VERSION }
26
27 1;
28 EOS
29
30 close VERSION;