[Box Backup-commit] COMMIT r1992 - box/chris/general/infrastructure/msvc

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 9 Dec 2007 12:11:13 +0000 (UTC)


Author: chris
Date: 2007-12-09 12:11:13 +0000 (Sun, 09 Dec 2007)
New Revision: 1992

Modified:
   box/chris/general/infrastructure/msvc/getversion.pl
Log:
Don't replace BoxVersion.h if it hasn't changed, saves rebuilding
everything.


Modified: box/chris/general/infrastructure/msvc/getversion.pl
===================================================================
--- box/chris/general/infrastructure/msvc/getversion.pl	2007-12-09 12:10:37 UTC (rev 1991)
+++ box/chris/general/infrastructure/msvc/getversion.pl	2007-12-09 12:11:13 UTC (rev 1992)
@@ -11,6 +11,20 @@
 
 require "$basedir\\infrastructure\\BoxPlatform.pm.in";
 
+my $version_string = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
+
+open VERSIONFILE, "< $basedir/lib/common/BoxVersion.h";
+my $old_version = <VERSIONFILE>;
+close VERSIONFILE;
+
+if ($old_version eq $version_string)
+{
+	print "Version unchanged.\n";
+	exit 0;
+}
+
+print "New version: $BoxPlatform::product_version\n";
+
 open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h" 
 	or die "BoxVersion.h: $!";
 print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";