[Box Backup-dev] COMMIT r757 - in box/chris/general: infrastructure lib/common lib/server

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Wed, 9 Aug 2006 22:51:24 +0000 (GMT)


Author: chris
Date: 2006-08-09 22:51:22 +0000 (Wed, 09 Aug 2006)
New Revision: 757

Modified:
   box/chris/general/infrastructure/BoxPlatform.pm.in
   box/chris/general/infrastructure/makebuildenv.pl.in
   box/chris/general/lib/common/makeexception.pl.in
   box/chris/general/lib/server/makeprotocol.pl.in
Log:
* infrastructure/makebuildenv.pl.in
* infrastructure/BoxPlatform.pm.in
* lib/server/makeprotocol.pl.in
* lib/common/makeexception.pl.in
- Reverted "only rewrite if changed" code which doesn't work on Win32
  native without Unix or Cygwin


Modified: box/chris/general/infrastructure/BoxPlatform.pm.in
===================================================================
--- box/chris/general/infrastructure/BoxPlatform.pm.in	2006-08-09 18:53:34 UTC (rev 756)
+++ box/chris/general/infrastructure/BoxPlatform.pm.in	2006-08-09 22:51:22 UTC (rev 757)
@@ -1,7 +1,7 @@
 package BoxPlatform;
 use Exporter;
 @ISA = qw/Exporter/;
-@EXPORT = qw/$build_os $build_cpu $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/;
+@EXPORT = qw/$build_os $build_cpu $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
 {
@@ -110,34 +110,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/general/infrastructure/makebuildenv.pl.in
===================================================================
--- box/chris/general/infrastructure/makebuildenv.pl.in	2006-08-09 18:53:34 UTC (rev 756)
+++ box/chris/general/infrastructure/makebuildenv.pl.in	2006-08-09 22:51:22 UTC (rev 757)
@@ -114,7 +114,7 @@
 print "done\n\n";
 
 
-# open test main program template file
+# open test mail program template file
 my $test_template_file = 'infrastructure/buildenv-testmain-template.cpp';
 open FL,$test_template_file or die "Can't open test template file\n";
 my $test_template;
@@ -296,8 +296,7 @@
 }
 
 # write a list of all the modules we've configured to use
-open CONFIGURED_MODS,'>local/modules.h.new' or die 
-	"Can't write configured modules list";
+open CONFIGURED_MODS,'>local/modules.h' or die "Can't write configured modules list";
 print CONFIGURED_MODS <<__E;
 // automatically generated file, do not edit
 #ifndef _CONFIGURED_MODULES__H
@@ -313,8 +312,8 @@
 #endif // _CONFIGURED_MODULES__H
 __E
 close CONFIGURED_MODS;
-update_if_changed("local/modules.h");
 
+
 # now make a list of all the .h files we can find, recording which module they're in
 my %hfiles;
 for my $mod (@modules, @implicit_deps)
@@ -394,19 +393,15 @@
 	{
 		my $testmain = $test_template;
 		$testmain =~ s/TEST_NAME/$name/g;
-		open TESTMAIN,">$mod/_main.cpp.new" or die 
-			"Can't open test main file for $mod for writing\n";
+		open TESTMAIN,">$mod/_main.cpp" or die "Can't open test main file for $mod for writing\n";
 		print TESTMAIN $testmain;
 		close TESTMAIN;
-		update_if_changed("$mod/_main.cpp");
 		
 		# test file...
 		sub writetestfile
 		{
 			my ($filename,$runcmd,$module) = @_;		
-			open TESTFILE,">$filename.new" or die 
-				"Can't open test script file for $module " .
-				"for writing\n";
+			open TESTFILE,">$filename" or die "Can't open test script file for $module for writing\n";
 			print TESTFILE "#!/bin/sh\necho TEST: $module\n";
 			if(-d "$module/testfiles")
 			{
@@ -425,7 +420,6 @@
 			}
 			print TESTFILE "$runcmd\n";
 			close TESTFILE;
-			update_if_changed($filename);
 		}
 		
 		writetestfile("$mod/_t", 
@@ -493,8 +487,7 @@
 
 	# start the makefile
 	my $mk_name_extra = ($bsd_make)?'':'X';
-	open MAKE,">$mod/Makefile".$mk_name_extra.".new" or die 
-		"Can't open Makefile for $mod\n";
+	open MAKE,">$mod/Makefile".$mk_name_extra or die "Can't open Makefile for $mod\n";
 	my $debug_link_extra = ($target_is_library)?'':'../../debug/lib/debug/debug.a';
 
 	my $release_flags = "-O2";
@@ -792,8 +785,8 @@
 	if(!$bsd_make)
 	{
 		# need to post process this into a GNU makefile
-		open MAKE,">$mod/Makefile.new" or die $!;
-		open MAKEB,"$mod/MakefileX.new" or die $!;
+		open MAKE,">$mod/Makefile";
+		open MAKEB,"$mod/MakefileX";
 
 		while(<MAKEB>)
 		{
@@ -805,10 +798,8 @@
 
 		close MAKEB;
 		close MAKE;
-		unlink "$mod/MakefileX.new";
+		unlink "$mod/MakefileX";
 	}
-
-	update_if_changed("$mod/Makefile");
 }
 
 print "\nType 'cd <module_dir>; $make_command' to build a module\n\n";

Modified: box/chris/general/lib/common/makeexception.pl.in
===================================================================
--- box/chris/general/lib/common/makeexception.pl.in	2006-08-09 18:53:34 UTC (rev 756)
+++ box/chris/general/lib/common/makeexception.pl.in	2006-08-09 22:51:22 UTC (rev 757)
@@ -1,11 +1,9 @@
 #!@PERL@
 
-use lib "../../infrastructure";
-use BoxPlatform;
-
 # global exception list file
 my $global_list = '../../ExceptionCodes.txt';
 
+
 my @exception;
 my @exception_desc;
 my $class;
@@ -48,8 +46,8 @@
 # write the code
 print "Generating $class exception...\n";
 
-open CPP,">autogen_${class}Exception.cpp.new" or die "Can't open cpp file for writing";
-open H,">autogen_${class}Exception.h.new" or die "Can't open h file for writing";
+open CPP,">autogen_${class}Exception.cpp" or die "Can't open cpp file for writing";
+open H,">autogen_${class}Exception.h" or die "Can't open h file for writing";
 
 # write header file
 my $guardname = uc 'AUTOGEN_'.$class.'EXCEPTION_H';
@@ -202,9 +200,6 @@
 close H;
 close CPP;
 
-update_if_changed("autogen_${class}Exception.cpp");
-update_if_changed("autogen_${class}Exception.h");
-
 # update the global exception list
 my $list_before;
 my $list_after;

Modified: box/chris/general/lib/server/makeprotocol.pl.in
===================================================================
--- box/chris/general/lib/server/makeprotocol.pl.in	2006-08-09 18:53:34 UTC (rev 756)
+++ box/chris/general/lib/server/makeprotocol.pl.in	2006-08-09 22:51:22 UTC (rev 757)
@@ -170,8 +170,8 @@
 
 # open files
 my $h_filename = 'autogen_'.$protocol_name.'Protocol'.$type.'.h';
-open CPP,'>autogen_'.$protocol_name.'Protocol'.$type.'.cpp.new';
-open H,">$h_filename.new";
+open CPP,'>autogen_'.$protocol_name.'Protocol'.$type.'.cpp';
+open H,">$h_filename";
 
 print CPP <<__E;
 
@@ -915,8 +915,6 @@
 close H;
 close CPP;
 
-update_if_changed('autogen_'.$protocol_name.'Protocol'.$type.'.cpp');
-update_if_changed($h_filename);
 
 sub obj_is_type
 {