From: Tom Lane Date: Tue, 5 Jan 2010 02:34:03 +0000 (+0000) Subject: Remove too-smart-for-its-own-good optimization of not overwriting the output X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=da2f3e4a34ef3d6e75e84f065afbe0f1c070e9a4;p=users%2Fandresfreund%2Fpostgres.git Remove too-smart-for-its-own-good optimization of not overwriting the output files when they haven't changed. This confuses make because the build fails to update the file timestamps, and so it keeps on doing the action over again. --- diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm index c32cad2eb6..241b252394 100644 --- a/src/backend/catalog/Catalog.pm +++ b/src/backend/catalog/Catalog.pm @@ -169,31 +169,12 @@ sub Catalogs return \%catalogs; } -# Rename temporary files to final names, if anything has changed. +# Rename temporary files to final names. # Call this function with the final file name --- we append .tmp automatically sub RenameTempFile { my $final_name = shift; my $temp_name = $final_name . '.tmp'; - if (-e $final_name && -s $temp_name == -s $final_name) - { - open TN, '<', "$temp_name" || die "$temp_name: $!"; - if (open FN, '<', $final_name) - { - local $/ = undef; - my $tn = ; - my $fn = ; - close FN; - if ($tn eq $fn) - { - print "$final_name unchanged, not replacing\n"; - close TN; - unlink($temp_name) || die "unlink: $temp_name: $!"; - return; - } - } - close TN; - } print "Writing $final_name\n"; rename($temp_name, $final_name) || die "rename: $temp_name: $!"; } diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index c02900d2c0..9ba1647cef 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -287,7 +287,7 @@ close DESCR; close SHDESCR; close SCHEMAPG; -# Rename temp files on top of final files, if they have changed +# Finally, rename the completed files into place. Catalog::RenameTempFile($output_path . 'postgres.bki'); Catalog::RenameTempFile($output_path . 'postgres.description'); Catalog::RenameTempFile($output_path . 'postgres.shdescription');