[Box Backup-dev] COMMIT r442 - in box/chris/win32/vc2005-compile-fixes: . bin/bbstored infrastructure lib/raidfile

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 12 Feb 2006 13:46:28 +0000 (GMT)


Author: chris
Date: 2006-02-12 13:46:24 +0000 (Sun, 12 Feb 2006)
New Revision: 442

Modified:
   box/chris/win32/vc2005-compile-fixes/bin/bbstored/backupprotocol.txt
   box/chris/win32/vc2005-compile-fixes/configure.ac
   box/chris/win32/vc2005-compile-fixes/infrastructure/BoxPlatform.pm.in
   box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl
   box/chris/win32/vc2005-compile-fixes/lib/raidfile/RaidFileWrite.cpp
Log:
* infrastructure/makeparcels.pl
* infrastructure/BoxPlatform.pm.in
* configure.ac
* lib/raidfile/RaidFileWrite.cpp
* bin/bbstored/backupprotocol.txt
- Merged fixes from trunk, r365 to r440


Modified: box/chris/win32/vc2005-compile-fixes/bin/bbstored/backupprotocol.txt
===================================================================
--- box/chris/win32/vc2005-compile-fixes/bin/bbstored/backupprotocol.txt	2006-02-12 13:37:36 UTC (rev 441)
+++ box/chris/win32/vc2005-compile-fixes/bin/bbstored/backupprotocol.txt	2006-02-12 13:46:24 UTC (rev 442)
@@ -3,7 +3,7 @@
 #
 
 Name 				Backup
-IdentString			Box-Backup:v=B
+IdentString			Box-Backup:v=C
 ServerContextClass	BackupContext	BackupContext.h
 
 ClientType		Filename	BackupStoreFilenameClear	BackupStoreFilenameClear.h

Modified: box/chris/win32/vc2005-compile-fixes/configure.ac
===================================================================
--- box/chris/win32/vc2005-compile-fixes/configure.ac	2006-02-12 13:37:36 UTC (rev 441)
+++ box/chris/win32/vc2005-compile-fixes/configure.ac	2006-02-12 13:46:24 UTC (rev 442)
@@ -186,7 +186,19 @@
   LIBS="-Wl,-Bstatic $LIBS -Wl,-Bdynamic"
 fi
 
+## Kludge to allow makeparcels.pl to use bindir. This is not a good long term
+## solution because it prevents use of "make exec_prefix=/some/dir"
+saved_prefix=$prefix
+saved_exec_prefix=$exec_prefix
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+bindir_expanded=`eval "echo $bindir"`
+bindir_expanded=`eval "echo $bindir_expanded"`
+prefix=$saved_prefix
+exec_prefix=$saved_exec_prefix
+AC_SUBST([bindir_expanded])
 
+
 ### Output files
 AC_CONFIG_FILES([infrastructure/BoxPlatform.pm])
 AC_OUTPUT

Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/chris/win32/vc2005-compile-fixes/infrastructure/BoxPlatform.pm.in	2006-02-12 13:37:36 UTC (rev 441)
+++ box/chris/win32/vc2005-compile-fixes/infrastructure/BoxPlatform.pm.in	2006-02-12 13:46:24 UTC (rev 442)
@@ -13,9 +13,9 @@
 	chomp $build_cpu;
 	# Cygwin Builds usually something like CYGWIN_NT-5.0, CYGWIN_NT-5.1
 	# Box Backup tried on Win2000,XP only :)
-	
-    $build_os = 'CYGWIN' if $build_os =~ m/CYGWIN/;
 
+	$build_os = 'CYGWIN' if $build_os =~ m/CYGWIN/;
+
 	$make_command = ($build_os eq 'Darwin') ? 'bsdmake' : ($build_os eq 'SunOS') ? 'gmake' : 'make';
 	$bsd_make = ($build_os ne 'Linux' && $build_os ne 'CYGWIN' && $build_os ne "SunOS");
 
@@ -34,10 +34,10 @@
 	$product_name = <VERSION>;
 	chomp $product_name;
 	close VERSION;
-	
+
 	# where to put the files
-	$install_into_dir = '@bindir@';
-	
+	$install_into_dir = '@bindir_expanded@';
+
 	# if it's Darwin,
 	if($build_os eq 'Darwin')
 	{

Modified: box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl
===================================================================
--- box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl	2006-02-12 13:37:36 UTC (rev 441)
+++ box/chris/win32/vc2005-compile-fixes/infrastructure/makeparcels.pl	2006-02-12 13:46:24 UTC (rev 442)
@@ -4,13 +4,6 @@
 use lib 'infrastructure';
 use BoxPlatform;
 
-my $os_suffix = '';
-if($build_os eq 'OpenBSD')
-{
-	$os_suffix = `uname -r`;
-	$os_suffix =~ tr/0-9//cd;
-}
-
 my @parcels;
 my %parcel_contents;
 
@@ -183,7 +176,7 @@
 
 sub parcel_root
 {
-	$product_name.'-'.$product_version.'-'.$_[0].'-'.$target_os.$os_suffix
+	$product_name.'-'.$product_version.'-'.$_[0].'-'.$target_os
 }
 
 sub parcel_dir

Modified: box/chris/win32/vc2005-compile-fixes/lib/raidfile/RaidFileWrite.cpp
===================================================================
--- box/chris/win32/vc2005-compile-fixes/lib/raidfile/RaidFileWrite.cpp	2006-02-12 13:37:36 UTC (rev 441)
+++ box/chris/win32/vc2005-compile-fixes/lib/raidfile/RaidFileWrite.cpp	2006-02-12 13:46:24 UTC (rev 442)
@@ -461,10 +461,11 @@
 						ASSERT(sizeof(RaidFileRead::FileSizeType) == (2*sizeof(unsigned int)));
 						ASSERT(sizeof(RaidFileRead::FileSizeType) >= sizeof(off_t));
 						int sizePos = (blockSize/sizeof(unsigned int)) - 2;
-						RaidFileRead::FileSizeType sw = box_hton64(writeFileStat.st_size);
-						unsigned int *psize = (unsigned int *)(&sw);
-						pparity[sizePos+0] = pstripe1[sizePos+0] ^ psize[0];
-						pparity[sizePos+1] = pstripe1[sizePos+1] ^ psize[1];
+						union { RaidFileRead::FileSizeType l; unsigned int i[2]; } sw;
+
+						sw.l = box_hton64(writeFileStat.st_size);
+						pparity[sizePos+0] = pstripe1[sizePos+0] ^ sw.i[0];
+						pparity[sizePos+1] = pstripe1[sizePos+1] ^ sw.i[1];
 					}
 					else
 					{