Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc98c35c

Browse files
committed
Avoid putting build-location-dependent strings into generated files.
Various Perl scripts we use to generate files were in the habit ofprinting things like "generated by $0" into their output files.That looks like a fine idea at first glance, but it results innon-reproducible output, because in VPATH builds $0 won't be justthe name of the script file, but a full path for it. We'd preferthat you get identical results whether using VPATH or not, so thisis a bad thing.Some of these places also printed their input file name(s), causingan additional hazard of the same type.Hence, establish a policy that thou shalt not print $0, nor input filepathnames, into output files (they're still allowed in error messages,though). Instead just write the script name verbatim. While we are atit, we can make these annotations more useful by giving the script'sfull relative path name within the PG source tree, eg instead ofGen_fmgrtab.pl let's print src/backend/utils/Gen_fmgrtab.pl.Not all of the changes made here actually affect any files shippedin finished tarballs today, but it seems best to apply the policyeveryplace so that nobody copies unsafe code into places where itcould matter.Christoph Berg and Tom LaneDiscussion:https://postgr.es/m/20171215102223.GB31812@msg.df7cb.de
1 parent59d1e2b commitc98c35c

17 files changed

+21
-26
lines changed

‎src/backend/catalog/genbki.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@
340340
* *** DO NOT EDIT THIS FILE! ***
341341
* ******************************
342342
*
343-
* It has been GENERATED by$0
343+
* It has been GENERATED bysrc/backend/catalog/genbki.pl
344344
*
345345
*-------------------------------------------------------------------------
346346
*/

‎src/backend/utils/Gen_fmgrtab.pl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@
118118
**** DO NOT EDIT THIS FILE! ***
119119
*******************************
120120
*
121-
*It has been GENERATED by$0
122-
*from$infile
121+
*It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
123122
*
124123
*-------------------------------------------------------------------------
125124
*/
@@ -153,8 +152,7 @@
153152
**** DO NOT EDIT THIS FILE! ***
154153
*******************************
155154
*
156-
*It has been GENERATED by$0
157-
*from$infile
155+
*It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
158156
*
159157
*-------------------------------------------------------------------------
160158
*/
@@ -181,8 +179,7 @@
181179
**** DO NOT EDIT THIS FILE! ***
182180
*******************************
183181
*
184-
*It has been GENERATED by$0
185-
*from$infile
182+
*It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
186183
*
187184
*-------------------------------------------------------------------------
188185
*/

‎src/backend/utils/mb/Unicode/UCS_to_BIG5.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
use strict;
2828
use convutils;
2929

30-
my$this_script =$0;
30+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_BIG5.pl';
3131

3232
# Load BIG5.TXT
3333
my$all = &read_source("BIG5.TXT");

‎src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use strict;
1717
use convutils;
1818

19-
my$this_script =$0;
19+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl';
2020

2121
# Read the input
2222

‎src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use strict;
1111
use convutils;
1212

13-
my$this_script =$0;
13+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_JIS_2004.pl';
1414

1515
# first generate UTF-8 --> EUC_JIS_2004 table
1616

‎src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use strict;
1515
use convutils;
1616

17-
my$this_script =$0;
17+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl';
1818

1919
# Load JIS0212.TXT
2020
my$jis0212 = &read_source("JIS0212.TXT");

‎src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use strict;
2020
use convutils;
2121

22-
my$this_script =$0;
22+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_KR.pl';
2323

2424
# Load the source file.
2525

‎src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use strict;
2121
use convutils;
2222

23-
my$this_script =$0;
23+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl';
2424

2525
my$mapping = &read_source("CNS11643.TXT");
2626

‎src/backend/utils/mb/Unicode/UCS_to_GB18030.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use strict;
1717
use convutils;
1818

19-
my$this_script =$0;
19+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_GB18030.pl';
2020

2121
# Read the input
2222

‎src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use strict;
1919
use convutils;
2020

21-
my$this_script =$0;
21+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_JOHAB.pl';
2222

2323
# Load the source file.
2424

‎src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# first generate UTF-8 --> SHIFT_JIS_2004 table
1414

15-
my$this_script =$0;
15+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_SHIFT_JIS_2004.pl';
1616

1717
my$in_file ="sjis-0213-2004-std.txt";
1818

‎src/backend/utils/mb/Unicode/UCS_to_SJIS.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use strict;
1414
use convutils;
1515

16-
my$this_script =$0;
16+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_SJIS.pl';
1717

1818
my$mapping = read_source("CP932.TXT");
1919

‎src/backend/utils/mb/Unicode/UCS_to_UHC.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use strict;
1717
use convutils;
1818

19-
my$this_script =$0;
19+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_UHC.pl';
2020

2121
# Read the input
2222

‎src/backend/utils/mb/Unicode/UCS_to_most.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use strict;
1919
use convutils;
2020

21-
my$this_script =$0;
21+
my$this_script ='src/backend/utils/mb/Unicode/UCS_to_most.pl';
2222

2323
my%filename = (
2424
'WIN866'=>'CP866.TXT',

‎src/bin/psql/create_help.pl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@
5151
* *** Do not change this file by hand. It is automatically
5252
* *** generated from the DocBook documentation.
5353
*
54-
* generated by
55-
* $^X$0@ARGV
54+
* generated by src/bin/psql/create_help.pl
5655
*
5756
*/
5857
@@ -76,8 +75,7 @@
7675
* *** Do not change this file by hand. It is automatically
7776
* *** generated from the DocBook documentation.
7877
*
79-
* generated by
80-
* $^X$0@ARGV
78+
* generated by src/bin/psql/create_help.pl
8179
*
8280
*/
8381
@@ -131,7 +129,7 @@
131129
my$nl_count = () =$cmdsynopsis =~/\n/g;
132130

133131
$cmdsynopsis =~m!</>!
134-
anddie"$0:$file: null end tag not supported in synopsis\n";
132+
anddie"$0:$file: null end tag not supported in synopsis\n";
135133
$cmdsynopsis =~s/%/%%/g;
136134

137135
while ($cmdsynopsis =~m!<(\w+)[^>]*>(.+?)</\1[^>]*>!)

‎src/pl/plperl/text2macro.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ =head1 DESCRIPTION
4040
printqq{
4141
/*
4242
* DO NOT EDIT - THIS FILE IS AUTOGENERATED - CHANGES WILL BE LOST
43-
*Written by$0 from@ARGV
43+
*Generated bysrc/pl/plperl/text2macro.pl
4444
*/
4545
};
4646

‎src/test/perl/TestLib.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ BEGIN
6666
delete$ENV{PGPORT};
6767
delete$ENV{PGHOST};
6868

69-
$ENV{PGAPPNAME} =$0;
69+
$ENV{PGAPPNAME} =basename($0);
7070

7171
# Must be set early
7272
$windows_os =$Config{osname}eq'MSWin32' ||$Config{osname}eq'msys';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp