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