Re: [HACKERS] Problems with src/pl/tcl/mkMakefile.tcldefs.sh.in in 6.5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-hackers(at)thewrittenword(dot)com, pgsql-hackers(at)postgreSQL(dot)org, pgsql-admin(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Problems with src/pl/tcl/mkMakefile.tcldefs.sh.in in 6.5
Date: 1999-07-10 15:37:24
Message-ID: 3705.931621044@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> writes:
> I understand what your patch does, and it looks OK, but any idea why the
> 'eval eval' was there, and is it safe to skip it?

I think the idea is to expand any shell variable references that appear
in tclConfig.sh. If so, the code is wrong anyway, since the expansion
will occur in a subshell that hasn't actually executed tclConfig.sh,
and therefore does not have definitions for the referenced variables.
We'll always get empty strings substituted for the references, and that
may be the wrong thing.

Taking an example that actually appears in my system's tclConfig.sh:
TCL_LIB_FILE='libtcl8.0${TCL_DBGX}.a'

I stick this into shell variable inp:

$ read inp
TCL_LIB_FILE='libtcl8.0${TCL_DBGX}.a' --- typed by me
$ echo $inp
TCL_LIB_FILE='libtcl8.0${TCL_DBGX}.a'

Now one eval gets rid of the outer single quotes:

$ eval echo $inp
TCL_LIB_FILE=libtcl8.0${TCL_DBGX}.a

and another one will perform a round of shell interpretation on what's
inside the quotes:

$ eval eval echo $inp
TCL_LIB_FILE=libtcl8.0.a

which is not what we want. In this particular case it's harmless
because TCL_DBGX should be empty, but if I had a debugging build
of Tcl installed here then the makefile would fail because it would
have the wrong value of TCL_LIB_FILE.

If we do something like what Albert is proposing, the sed script
will need to convert ${...} to $(...) so that shell variable references
become make variable references.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-10 17:16:21 6.5.1 release
Previous Message Tom Lane 1999-07-10 15:06:51 Re: [HACKERS] 6.5.1