[Box Backup-commit] COMMIT r3019 - box/trunk/infrastructure/msvc
subversion at boxbackup.org
subversion at boxbackup.org
Tue Oct 11 22:05:43 BST 2011
Author: chris
Date: 2011-10-11 22:05:43 +0100 (Tue, 11 Oct 2011)
New Revision: 3019
Modified:
box/trunk/infrastructure/msvc/getversion.pl
Log:
Don't die if BoxVersion.h doesn't exist yet.
Modified: box/trunk/infrastructure/msvc/getversion.pl
===================================================================
--- box/trunk/infrastructure/msvc/getversion.pl 2011-10-09 22:52:00 UTC (rev 3018)
+++ box/trunk/infrastructure/msvc/getversion.pl 2011-10-11 21:05:43 UTC (rev 3019)
@@ -11,17 +11,21 @@
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;
}
More information about the Boxbackup-commit
mailing list