Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9d781b5

Browse files
committed
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.
1 parent c3a1eae commit 9d781b5

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

src/backend/catalog/Catalog.pm

+2-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
# Portions Copyright (c) 1994, Regents of the University of California
99
#
10-
# $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.1 2010/01/05 01:06:56 tgl Exp $
10+
# $PostgreSQL: pgsql/src/backend/catalog/Catalog.pm,v 1.2 2010/01/05 02:34:03 tgl Exp $
1111
#
1212
#----------------------------------------------------------------------
1313

@@ -169,31 +169,12 @@ sub Catalogs
169169
return \%catalogs;
170170
}
171171

172-
# Rename temporary files to final names, if anything has changed.
172+
# Rename temporary files to final names.
173173
# Call this function with the final file name --- we append .tmp automatically
174174
sub RenameTempFile
175175
{
176176
my $final_name = shift;
177177
my $temp_name = $final_name . '.tmp';
178-
if (-e $final_name && -s $temp_name == -s $final_name)
179-
{
180-
open TN, '<', "$temp_name" || die "$temp_name: $!";
181-
if (open FN, '<', $final_name)
182-
{
183-
local $/ = undef;
184-
my $tn = <TN>;
185-
my $fn = <FN>;
186-
close FN;
187-
if ($tn eq $fn)
188-
{
189-
print "$final_name unchanged, not replacing\n";
190-
close TN;
191-
unlink($temp_name) || die "unlink: $temp_name: $!";
192-
return;
193-
}
194-
}
195-
close TN;
196-
}
197178
print "Writing $final_name\n";
198179
rename($temp_name, $final_name) || die "rename: $temp_name: $!";
199180
}

src/backend/catalog/genbki.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
1111
# Portions Copyright (c) 1994, Regents of the University of California
1212
#
13-
# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.1 2010/01/05 01:06:56 tgl Exp $
13+
# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.2 2010/01/05 02:34:03 tgl Exp $
1414
#
1515
#----------------------------------------------------------------------
1616

@@ -287,7 +287,7 @@
287287
close SHDESCR;
288288
close SCHEMAPG;
289289

290-
# Rename temp files on top of final files, if they have changed
290+
# Finally, rename the completed files into place.
291291
Catalog::RenameTempFile($output_path . 'postgres.bki');
292292
Catalog::RenameTempFile($output_path . 'postgres.description');
293293
Catalog::RenameTempFile($output_path . 'postgres.shdescription');

0 commit comments

Comments
 (0)