libtool-patches
[Top][All Lists]
Advanced

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

Re: FYI: Set IFS in libtool for ash


From: Ralf Wildenhues
Subject: Re: FYI: Set IFS in libtool for ash
Date: Wed, 16 Mar 2005 18:23:01 +0100
User-agent: Mutt/1.4.1i

Hi Gary,

* Gary V. Vaughan wrote on Wed, Mar 16, 2005 at 05:27:37PM CET:
> Ralf Wildenhues wrote:
> > * Gary V. Vaughan wrote on Wed, Mar 16, 2005 at 03:40:29PM CET:
> > >
> > > I think keeping the intermediate variable is worthwhile.  Infact, ISTR 
> > > having
> > > used a \012\011\040 ordering to avoid accidental trailing whitespace 
> > > cleanups
> > > in the past (quite possibly dotted around the libtool source tree even 
> > > now!).
> > 
> > $SP2NL, $NL2SP.
> > 
> > (am thinking, maybe I should use that in the pgi patch, looks much nicer).
> 
> That's not the same thing; All I meant is that because of trailing whitespace
> stripping I have historically used

Ah, ok.

> (in your notation):
> IFS='$
>  ^I'$

Not my notation.  vim -c 'set list'  :)

> >>If this patch is needed to address a known problem with ash, maybe it should
> >>be submitted to the autoconf list too, for inclusion in AS_SHELL_SANITIZE?
> > 
> > Hmm.  ash does not sets IFS by default.  Why does it break?
> 
> That's very odd.  How can it do anything without IFS?  Do you mean that the
> variable is not set, but the shell behaves as if it had a sensible whitespace
> default?  All the more reason to push this upstream to autoconf IMHO.

Yep.  Turns out this is a bug in ash-0.3.8-20 of Fedora Core 3[1]. The
manual states that IFS is set to space tab newline by default, but it is
not.  Now while I am not sure whether having IFS unset on startup is
against POSIX (SUSv3 does not look like it), this _is_ a documentation
bug of that particular ash version.  Given the age, no wonder[2].
Apparently RedHat are trying to get rid of it anyway.[3]  Given that the
downloadable versions contain vastly incomplete ChangeLog's (they end at
2004-05-28, and the continuation ChangeLog.0 is not provided), I might
be able to understand them.  For those wanting to know more, a Debian
package has more information.

> > OK to apply this patch to remove my broken one and set IFS default
> > sensibly?  Or should I rather set it unconditionally?
> 
> It is unconditional! ;-)

Yeah, my mail was full of errors.  I meant conditionally.
But it will be unconditional.

> I agree with this patch.  Please apply.  This needs backporting to several
> places that use my conditional `: ${IFS="...' breakage in branch-1-5 too.

Applied similarly to all branches.  Will report on the autoconf list,
too, in case they want this in AS_SHELL_SANITIZE, and not only in
AS_PREPARE.

My next patch will hopefully set dependencies on general.m4sh straight
(watch out -- test/defs is not rebuilt right now).

Regards,
Ralf

[1] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=151276
[2] http://gondor.apana.org.au/~herbert/dash/
[3] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=131857


        * config/general.m4sh: unconditionally set IFS, and set it
        to the one true right sequence: space, tab, newline.
        * m4/libtool.m4: remove IFS setting and as_* namespace infringement.

Index: config/general.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/config/general.m4sh,v
retrieving revision 1.2.2.9
diff -u -r1.2.2.9 general.m4sh
--- config/general.m4sh 28 Dec 2004 12:40:10 -0000      1.2.2.9
+++ config/general.m4sh 16 Mar 2005 15:54:29 -0000
@@ -48,8 +48,9 @@
 exit_status=$EXIT_SUCCESS
 
 # Make sure IFS has a sensible default
-: ${IFS="
-       "}
+lt_nl='
+'
+IFS="  $lt_nl"
 
 dirname="s,/[[^/]]*$,,"
 basename="s,^.*/,,g"
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.125.2.37
diff -u -r1.125.2.37 libtool.m4
--- m4/libtool.m4       16 Mar 2005 10:08:17 -0000      1.125.2.37
+++ m4/libtool.m4       16 Mar 2005 15:54:29 -0000
@@ -517,12 +517,6 @@
 _LT_LIBTOOL_TAG_VARS
 # ### END LIBTOOL CONFIG
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
 # The HP-UX ksh and POSIX shell print the target directory to stdout
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH




reply via email to

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