source: box/trunk/infrastructure/msvc/getversion.pl @ 3019

Revision 3019, 733 bytes checked in by chris, 7 months ago (diff)

Don't die if BoxVersion?.h doesn't exist yet.

Line 
1#!perl
2
3$basedir = $0;
4$basedir =~ s/\\[^\\]*$//;
5$basedir =~ s/\\[^\\]*$//;
6$basedir =~ s/\\[^\\]*$//;
7$basedir =~ s/\\[^\\]*$//;
8$basedir =~ s/\\[^\\]*$//;
9-d $basedir or die "$basedir: $!";
10chdir $basedir or die "$basedir: $!";
11
12require "$basedir\\infrastructure\\BoxPlatform.pm.in";
13
14my $verfile = "$basedir/lib/common/BoxVersion.h";
15my $newver = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
16my $oldver = "";
17
18if (-r $verfile)
19{
20        open VERSIONFILE, "< $verfile" or die "$verfile: $!";
21        $oldver = <VERSIONFILE>;
22        close VERSIONFILE;
23
24}
25
26if ($newver ne $oldver)
27{
28        open VERSIONFILE, "> $verfile" or die "BoxVersion.h: $!";
29        print VERSIONFILE $newver;
30        close VERSIONFILE;
31}
32
33print $BoxPlatform::product_version;
34exit 0;
Note: See TracBrowser for help on using the repository browser.