|
10 | 10 | # Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
11 | 11 | # Portions Copyright (c) 1994, Regents of the University of California
|
12 | 12 | #
|
13 |
| -# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.3 2010/01/05 06:41:44 tgl Exp $ |
| 13 | +# $PostgreSQL: pgsql/src/backend/catalog/genbki.pl,v 1.4 2010/01/05 20:23:32 tgl Exp $ |
14 | 14 | #
|
15 | 15 | #----------------------------------------------------------------------
|
16 | 16 |
|
|
62 | 62 | }
|
63 | 63 |
|
64 | 64 | # Open temp files
|
65 |
| -open BKI, '>', $output_path . 'postgres.bki.tmp' |
66 |
| - || die "can't open postgres.bki.tmp: $!"; |
67 |
| -open SCHEMAPG, '>', $output_path . 'schemapg.h.tmp' |
68 |
| - || die "can't open 'schemapg.h.tmp: $!"; |
69 |
| -open DESCR, '>', $output_path . 'postgres.description.tmp' |
70 |
| - || die "can't open postgres.description.tmp: $!"; |
71 |
| -open SHDESCR, '>', $output_path . 'postgres.shdescription.tmp' |
72 |
| - || die "can't open postgres.shdescription.tmp: $!"; |
| 65 | +my $tmpext = ".tmp$$"; |
| 66 | +my $bkifile = $output_path . 'postgres.bki'; |
| 67 | +open BKI, '>', $bkifile . $tmpext |
| 68 | + or die "can't open $bkifile$tmpext: $!"; |
| 69 | +my $schemafile = $output_path . 'schemapg.h'; |
| 70 | +open SCHEMAPG, '>', $schemafile . $tmpext |
| 71 | + or die "can't open $schemafile$tmpext: $!"; |
| 72 | +my $descrfile = $output_path . 'postgres.description'; |
| 73 | +open DESCR, '>', $descrfile . $tmpext |
| 74 | + or die "can't open $descrfile$tmpext: $!"; |
| 75 | +my $shdescrfile = $output_path . 'postgres.shdescription'; |
| 76 | +open SHDESCR, '>', $shdescrfile . $tmpext |
| 77 | + or die "can't open $shdescrfile$tmpext: $!"; |
73 | 78 |
|
74 | 79 | # Fetch some special data that we will substitute into the output file.
|
75 | 80 | # CAUTION: be wary about what symbols you substitute into the .bki file here!
|
|
283 | 288 |
|
284 | 289 | # We're done emitting data
|
285 | 290 | close BKI;
|
| 291 | +close SCHEMAPG; |
286 | 292 | close DESCR;
|
287 | 293 | close SHDESCR;
|
288 |
| -close SCHEMAPG; |
289 | 294 |
|
290 | 295 | # Finally, rename the completed files into place.
|
291 |
| -Catalog::RenameTempFile($output_path . 'postgres.bki'); |
292 |
| -Catalog::RenameTempFile($output_path . 'postgres.description'); |
293 |
| -Catalog::RenameTempFile($output_path . 'postgres.shdescription'); |
294 |
| -Catalog::RenameTempFile($output_path . 'schemapg.h'); |
| 296 | +Catalog::RenameTempFile($bkifile, $tmpext); |
| 297 | +Catalog::RenameTempFile($schemafile, $tmpext); |
| 298 | +Catalog::RenameTempFile($descrfile, $tmpext); |
| 299 | +Catalog::RenameTempFile($shdescrfile, $tmpext); |
295 | 300 |
|
296 | 301 | exit 0;
|
297 | 302 |
|
|
0 commit comments