libtool-patches
[Top][All Lists]
Advanced

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

Re: [RFC PATCH] Strip trailing slashes from libdir and destdir


From: Ralf Wildenhues
Subject: Re: [RFC PATCH] Strip trailing slashes from libdir and destdir
Date: Sat, 9 Oct 2010 11:05:25 +0200
User-agent: Mutt/1.5.20 (2010-08-04)

* Paolo Bonzini wrote on Sat, Oct 09, 2010 at 10:51:34AM CEST:
> I found this patch at OpenEmbedded,
> http://lists.linuxtogo.org/pipermail/openembedded-devel/2010-October/025133.html
> 
> It looks to me like the code can be simplified by unconditionally
> stripping trailing slashes from $libdir and $destdir (i.e. not
> introducing the new variables).  Ideas?

Probably ok, but I'd really like coverage for the bug this fixes.
I know there is a bug, it's been reported more than once, but I
don't recall that I had an exposer.

The Automake 1.11+ code exposed this IIRC, because it started installing
more than one library at once, and with a directory as destination
argument (rather than directory/libfile.la).

Thanks,
Ralf

> * libltdl/config/ltmain.m4sh (func_mode_install): Check if
> $destdir ends with $libdir only after stripping trailing slashes
> from both.  Patch from Gary Thomas <address@hidden> and
> Nitin A Kamble <address@hidden>.

For people added to THANKS you can omit email addresses in the
ChangeLog.

> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh
> @@ -2164,8 +2164,15 @@ func_mode_install ()
>       func_append dir "$objdir"
>  
>       if test -n "$relink_command"; then
> +          # Strip any trailing slash from the destination.
> +          func_stripname '' '/' "$libdir"
> +          destlibdir=$func_stripname_result
> +
> +          func_stripname '' '/' "$destdir"
> +          s_destdir=$func_stripname_result

The indentation is wrong.

>         # Determine the prefix the user has applied to our future dir.
> -       inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
> +       inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
>  
>         # Don't allow the user to place us outside of our expected
>         # location b/c this prevents finding dependent libraries that
> @@ -2173,7 +2180,7 @@ func_mode_install ()
>         # At present, this check doesn't affect windows .dll's that
>         # are installed into $libdir/../bin (currently, that works fine)
>         # but it's something to keep an eye on.
> -       test "$inst_prefix_dir" = "$destdir" && \
> +       test "$inst_prefix_dir" = "$s_destdir" && \
>           func_fatal_error "error: cannot install \`$file' to a directory not 
> ending in $libdir"
>  
>         if test -n "$inst_prefix_dir"; then




reply via email to

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