[Box Backup-dev] COMMIT r815 - in box/chris/merge: . bin/bbackupd infrastructure

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Wed Aug 30 09:53:55 BST 2006


Author: chris
Date: 2006-08-30 09:53:55 +0100 (Wed, 30 Aug 2006)
New Revision: 815

Modified:
   box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
   box/chris/merge/infrastructure/BoxPlatform.pm.in
   box/chris/merge/win32.bat
Log:
* infrastructure/BoxPlatform.pm.in
* win32.bat
* bin/bbackupd/BackupClientDirectoryRecord.cpp
- Merged back changes from trunk


Modified: box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp	2006-08-27 21:36:35 UTC (rev 814)
+++ box/chris/merge/bin/bbackupd/BackupClientDirectoryRecord.cpp	2006-08-30 08:53:55 UTC (rev 815)
@@ -97,6 +97,33 @@
 // --------------------------------------------------------------------------
 //
 // Function
+//		Name:    MakeFullPath(const std::string& rDir, const std::string& rFile)
+//		Purpose: Combine directory and file name
+//		Created: 2006/08/10
+//
+// --------------------------------------------------------------------------
+static std::string MakeFullPath(const std::string& rDir, 
+	const std::string& rFile)
+{
+	std::string result;
+
+	if (rDir.size() > 0 && 
+		rDir[rDir.size()-1] == DIRECTORY_SEPARATOR_ASCHAR)
+	{
+		result = rDir + rFile;
+	}
+	else
+	{
+		result = rDir + DIRECTORY_SEPARATOR + rFile;
+	}
+
+	return result;
+}
+
+
+// --------------------------------------------------------------------------
+//
+// Function
 //		Name:    BackupClientDirectoryRecord::SyncDirectory(BackupClientDirectoryRecord::SyncParams &, int64_t, const std::string &, bool)
 //		Purpose: Syncronise, recusively, a local directory with the server.
 //		Created: 2003/10/08
@@ -207,8 +234,7 @@
 				}
 
 				// Stat file to get info
-				filename = rLocalPath + DIRECTORY_SEPARATOR + 
-					en->d_name;
+				filename = MakeFullPath(rLocalPath, en->d_name);
 
 				if(::lstat(filename.c_str(), &st) != 0)
 				{
@@ -512,7 +538,7 @@
 		f != rFiles.end(); ++f)
 	{
 		// Filename of this file
-		std::string filename(rLocalPath + DIRECTORY_SEPARATOR + *f);
+		std::string filename(MakeFullPath(rLocalPath, *f));
 
 		// Get relevant info about file
 		box_time_t modTime = 0;
@@ -859,7 +885,7 @@
 		d != rDirs.end(); ++d)
 	{
 		// Get the local filename
-		std::string dirname(rLocalPath + DIRECTORY_SEPARATOR + *d);		
+		std::string dirname(MakeFullPath(rLocalPath, *d));
 	
 		// See if it's in the listing (if we have one)
 		BackupStoreFilenameClear storeFilename(*d);
@@ -1063,10 +1089,13 @@
 					BackupClientDirectoryRecord *rec = e->second;
 					mSubDirectories.erase(e);
 					delete rec;
-					TRACE2("Deleted directory record for "
-						"%s" DIRECTORY_SEPARATOR "%s\n",
-						rLocalPath.c_str(), 
-						dirname.GetClearFilename().c_str());
+
+					std::string name = MakeFullPath(
+						rLocalPath, 
+						dirname.GetClearFilename());
+
+					TRACE1("Deleted directory record for "
+						"%s\n", name.c_str());
 				}				
 			}
 		}

Modified: box/chris/merge/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/chris/merge/infrastructure/BoxPlatform.pm.in	2006-08-27 21:36:35 UTC (rev 814)
+++ box/chris/merge/infrastructure/BoxPlatform.pm.in	2006-08-30 08:53:55 UTC (rev 815)
@@ -1,7 +1,7 @@
 package BoxPlatform;
 use Exporter;
 @ISA = qw/Exporter/;
- at EXPORT = qw/$build_os $target_os $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files $platform_exe_ext $target_windows update_if_changed/;
+ at EXPORT = qw/$build_os $target_os $make_command $bsd_make $platform_define $platform_cpu $gcc_v3 $product_version $product_name $install_into_dir $sub_make_options $platform_compile_line_extra $platform_link_line_extra $platform_lib_files $platform_exe_ext $target_windows/;
 
 BEGIN
 {
@@ -24,7 +24,6 @@
 
 	# 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/;
 
 	$make_command = ($build_os eq 'Darwin') ? 'bsdmake' : ($build_os eq 'SunOS') ? 'gmake' : 'make';
@@ -107,34 +106,5 @@
 	return $_[0].'=1';
 }
 
-sub update_if_changed ($)
-{
-	my ($file) = @_;
-	die "$file.new: not found" unless -r "$file.new";
-
-	if (-r $file)
-	{
-		die "$file.new: not found" unless -r "$file.new";
-		if (system("diff --brief $file $file.new") == 0)
-		{
-			unlink "$file.new";
-			return;
-		}
-	}
-
-	if (system("cp $file.new $file") != 0)
-	{
-		die "failed to copy $file.new to $file";
-	}
-
-	if (system("diff --brief $file $file.new") != 0)
-	{
-		die "$file and $file.new are still different";
-	}
-
-	unlink "$file.new";
-	return;
-}
-
 1;
 

Modified: box/chris/merge/win32.bat
===================================================================
--- box/chris/merge/win32.bat	2006-08-27 21:36:35 UTC (rev 814)
+++ box/chris/merge/win32.bat	2006-08-30 08:53:55 UTC (rev 815)
@@ -5,26 +5,27 @@
 
 copy .\infrastructure\BoxPlatform.pm.in .\infrastructure\BoxPlatform.pm
 
-cd .\bin\bbackupquery\ & perl ./../../bin/bbackupquery/makedocumentation.pl
+cd .\bin\bbackupquery\ & perl ./../../bin/bbackupquery/makedocumentation.pl.in
 cd ..\..\
 
-cd .\lib\backupclient & perl ./../../lib/common/makeexception.pl BackupStoreException.txt
-perl ./../../lib/server/makeprotocol.pl Client ./../../bin/bbstored/backupprotocol.txt
+cd .\lib\backupclient & perl ./../../lib/common/makeexception.pl.in BackupStoreException.txt & perl ./../../lib/server/makeprotocol.pl.in Client ./../../bin/bbstored/backupprotocol.txt
 cd ..\..\
 
-cd .\lib\compress & perl ./../../lib/common/makeexception.pl CompressException.txt
+cd .\lib\compress & perl ./../../lib/common/makeexception.pl.in CompressException.txt
 cd ..\..\
 
-cd .\lib\common & perl ./../../lib/common/makeexception.pl CommonException.txt & perl ./../../lib/common/makeexception.pl ConversionException.txt
+cd .\lib\common & perl ./../../lib/common/makeexception.pl.in CommonException.txt & perl ./../../lib/common/makeexception.pl.in ConversionException.txt
 
 cd ..\..\
 
-cd .\lib\crypto & perl ./../../lib/common/makeexception.pl CipherException.txt
+cd .\lib\crypto & perl ./../../lib/common/makeexception.pl.in CipherException.txt
 cd ..\..\
 
 echo server parts - which appears as though some of the clients rely on
 
-cd .\lib\server & perl ./../../lib/common/makeexception.pl ServerException.txt & perl ./../../lib/common/makeexception.pl ConnectionException.txt
+cd .\lib\server & perl ./../../lib/common/makeexception.pl.in ServerException.txt & perl ./../../lib/common/makeexception.pl.in ConnectionException.txt
 cd ..\..\
 
-perl -i.orig -pe 's/@PERL@/perl/' ./test/bbackupd/testfiles/bbackupd.conf
+copy lib\win32\config.h.win32 lib\common\BoxConfig.h
+
+perl -pe 's/@PERL@/perl/' ./test/bbackupd/testfiles/bbackupd.conf.in > .\test\bbackupd\testfiles\bbackupd.conf




More information about the Boxbackup-dev mailing list