diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-10-11 21:05:43 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-10-11 21:05:43 +0000 |
commit | 5f0eb202900fac5959f666b977164ca9897152c3 (patch) | |
tree | f11dc692f5d581e8dbf00419d38d5cf881d6196b /infrastructure | |
parent | 44376290b3bdea1c0a40fa070e9a2740f10f1e62 (diff) |
Don't die if BoxVersion.h doesn't exist yet.
Diffstat (limited to 'infrastructure')
-rw-r--r-- | infrastructure/msvc/getversion.pl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/infrastructure/msvc/getversion.pl b/infrastructure/msvc/getversion.pl index 909f4a30..0cf9cbcb 100644 --- a/infrastructure/msvc/getversion.pl +++ b/infrastructure/msvc/getversion.pl @@ -11,17 +11,21 @@ chdir $basedir or die "$basedir: $!"; require "$basedir\\infrastructure\\BoxPlatform.pm.in"; +my $verfile = "$basedir/lib/common/BoxVersion.h"; my $newver = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n"; +my $oldver = ""; -open VERSIONFILE, "< $basedir/lib/common/BoxVersion.h" - or die "BoxVersion.h: $!"; -my $oldver = <VERSIONFILE>; -close VERSIONFILE; +if (-r $verfile) +{ + open VERSIONFILE, "< $verfile" or die "$verfile: $!"; + $oldver = <VERSIONFILE>; + close VERSIONFILE; + +} if ($newver ne $oldver) { - open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h" - or die "BoxVersion.h: $!"; + open VERSIONFILE, "> $verfile" or die "BoxVersion.h: $!"; print VERSIONFILE $newver; close VERSIONFILE; } |