libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cygwin breakage


From: Noah Misch
Subject: Re: cygwin breakage
Date: Tue, 19 Oct 2004 00:24:51 -0700
User-agent: Mutt/1.5.6i

On Mon, Oct 18, 2004 at 09:51:08AM +0100, Gary V. Vaughan wrote:

> >+ eval $show ""if test "x`/usr/bin/sed 1q .libs/libfoo2.exp`" = xEXPORTS; 
> >then cp .libs/libfoo2.exp .libs/cygfoo2-0.dll.def; else echo EXPORTS > 
> >.libs/cygfoo2-0.dll.def; cat .libs/libfoo2.exp >> .libs/cygfoo2-0.dll.def; 
> >fi""
> >+ /usr/bin/sed 1q .libs/libfoo2.exp
> >+ echo if test xlibfoo2_LTX_foo2 = xEXPORTS
> >if test xlibfoo2_LTX_foo2 = xEXPORTS
> >eval: 1: Syntax error: "then" unexpected
> >
> >The two pairs of quotes cancel, so the variable expansion evals 
> >unprotected.
> >
> >-eval \$show \"$func_quote_for_eval_result\"
> >+eval \$show "$func_quote_for_eval_result"
> >
> >plugs the failure in this case, but I think it unfixes the problem Peter 
> >was
> >trying to fix.  Indeed, ``$show "$my_arg"'' is equivalent.  Hmmm.
> 
> I had come to the same conclusion, and after *a lot* of buggering about 
> with quote
> substitution and sed in func_quote_for_eval managed to come up with the 
> sed magic needed to protect the expression returned in 
> $func_quote_for_eval_result from early expansion...
> 
> As it turns out, your untested patch at:
> 
> http://lists.gnu.org/archive/html/libtool/2004-10/msg00127.html
> 
> is a much better generalised analysis and cleaner patch that mine.
> 
> As I had hoped, this also paves the road to cleaning up all the 
> $show/$run cruft on HEAD.  Excellent catch!

Thank you.  I also wrote a test case that validates the behavior of
func_quote_for_eval with the invariant I proposed in that message, using a
number of metacharacters.  I will clean it up for inclusion.

There remains the issue of expanding parameters in the ``$show'' of an ``eval
$run''ed command.  func_quote_for_eval'ing the command prevents word splitting,
command substitution, and parameter expansion.  We need something else, call it
func_quote_for_expand, that only stops word splitting and command substitution.
I have attached a sample implementation.  With something like it, one writes:

func_quote_for_expand "$cmd"
eval "$show $func_quote_for_expand_result"
$run eval "$cmd"

> I've successfully run the testsuite on my powerbook, and the failing
> mdemo tests are now working on cygwin.  To be doubly sure there are no 
> regressions, I am running the entire testsuite on cygwin before I 
> commit.  I expect it to take another 12-18 hours for that to complete
> (assuming Windows 98 can stay up that long under heavy processor load ;-)).

The Autoconf test suite has taken up residence on my 486/33 laptop.  It appears
on track for completion within sixteen hours.

Attachment: quote_for_expand.sh
Description: Bourne shell script


reply via email to

[Prev in Thread] Current Thread [Next in Thread]