Correct portability problem introduced by yours truly --- I used a
conditional expression x?y:z in an awk program. Seems old versions of awk don't have that ...
This commit is contained in:
parent
6437fe62ba
commit
bff5dce993
@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
|
# $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
|
||||||
#
|
#
|
||||||
# NOTES
|
# NOTES
|
||||||
# Passes any -D options on to cpp prior to generating the list
|
# Passes any -D options on to cpp prior to generating the list
|
||||||
@ -82,7 +82,7 @@ cat > $OIDSFILE <<FuNkYfMgRsTuFf
|
|||||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
|
* $Id: Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* ******************************
|
* ******************************
|
||||||
@ -105,8 +105,8 @@ cat > $OIDSFILE <<FuNkYfMgRsTuFf
|
|||||||
* For example, we want to be able to assign different macro names to both
|
* For example, we want to be able to assign different macro names to both
|
||||||
* char_text() and int4_text() even though these both appear with proname
|
* char_text() and int4_text() even though these both appear with proname
|
||||||
* 'text'. If the same C function appears in more than one pg_proc entry,
|
* 'text'. If the same C function appears in more than one pg_proc entry,
|
||||||
* its equivalent macro will be defined with the OID of the entry appearing
|
* its equivalent macro will be defined with the lowest OID among those
|
||||||
* first in pg_proc.h.
|
* entries.
|
||||||
*/
|
*/
|
||||||
FuNkYfMgRsTuFf
|
FuNkYfMgRsTuFf
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ cat > $TABLEFILE <<FuNkYfMgRtAbStUfF
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.23 2000/05/29 20:18:30 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/Attic/Gen_fmgrtab.sh.in,v 1.24 2000/06/02 02:00:28 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -170,11 +170,19 @@ cat >> $TABLEFILE <<FuNkYfMgRtAbStUfF
|
|||||||
const FmgrBuiltin fmgr_builtins[] = {
|
const FmgrBuiltin fmgr_builtins[] = {
|
||||||
FuNkYfMgRtAbStUfF
|
FuNkYfMgRtAbStUfF
|
||||||
|
|
||||||
awk '{ printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \
|
# Note: using awk arrays to translate from pg_proc values to fmgrtab values
|
||||||
$1, $(NF-1), $9, \
|
# may seem tedious, but avoid the temptation to write a quick x?y:z
|
||||||
($8 == "t") ? "true" : "false", \
|
# conditional expression instead. Not all awks have conditional expressions.
|
||||||
($4 == "11") ? "true" : "false", \
|
|
||||||
$(NF-1) }' $RAWFILE >> $TABLEFILE
|
awk 'BEGIN {
|
||||||
|
Strict["t"] = "true"
|
||||||
|
Strict["f"] = "false"
|
||||||
|
OldStyle["11"] = "true"
|
||||||
|
OldStyle["12"] = "false"
|
||||||
|
}
|
||||||
|
{ printf (" { %d, \"%s\", %d, %s, %s, %s },\n"), \
|
||||||
|
$1, $(NF-1), $9, Strict[$8], OldStyle[$4], $(NF-1)
|
||||||
|
}' $RAWFILE >> $TABLEFILE
|
||||||
|
|
||||||
cat >> $TABLEFILE <<FuNkYfMgRtAbStUfF
|
cat >> $TABLEFILE <<FuNkYfMgRtAbStUfF
|
||||||
/* dummy entry is easier than getting rid of comma after last real one */
|
/* dummy entry is easier than getting rid of comma after last real one */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user