libtool-patches
[Top][All Lists]
Advanced

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

Re: FYI: [PATCH] ltmain.sh: append relative path trailing slashes explic


From: Peter Rosin
Subject: Re: FYI: [PATCH] ltmain.sh: append relative path trailing slashes explicitly.
Date: Mon, 14 Nov 2011 15:52:37 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Gary V. Vaughan skrev 2011-11-14 11:44:
> A small refactoring necessary to enable upcoming changesets.
> 
> Applied as obvious.
> 
> In addition to being more idiomatic, and hence minimising

minimizing, I think US English is preferred.

> suprises, seeing the slash written explicity when appending to

surprises, explicitly

> the result of a relative path calculation is a lot more
> readable.
> * libltdl/config/general.m4sh (func_relative_path): Don't append
> an implicit trailing slash...
> * libltdl/config/ltmain.m4sh (func_mode_link): ...write it
> explicitly at the time of use.
> 
> Signed-off-by: Gary V. Vaughan <address@hidden>
> ---
>  libltdl/config/general.m4sh |    9 +++------
>  libltdl/config/ltmain.m4sh  |    2 +-
>  2 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/libltdl/config/general.m4sh b/libltdl/config/general.m4sh
> index 40d5413..f1ee6e5 100644
> --- a/libltdl/config/general.m4sh
> +++ b/libltdl/config/general.m4sh
> @@ -221,9 +221,7 @@ func_normal_abspath ()
>  }
>  
>  # func_relative_path SRCDIR DSTDIR
> -# generates a relative path from SRCDIR to DSTDIR, with a trailing
> -# slash if non-empty, suitable for immediately appending a filename
> -# without needing to append a separator.
> +# generates a relative path from SRCDIR to DSTDIR.
>  #             value returned in "$func_relative_path_result"
>  func_relative_path ()
>  {
> @@ -274,10 +272,9 @@ func_relative_path ()
>    fi
>  
>    # Normalisation. If bindir is libdir, return empty string,
> -  # else relative path ending with a slash; either way, target
> -  # file name can be directly appended.
> +  # else relative path.
>    if test ! -z "$func_relative_path_result"; then
> -    func_stripname './' '' "$func_relative_path_result/"
> +    func_stripname './' '' "$func_relative_path_result"
>      func_relative_path_result=$func_stripname_result
>    fi
>  }
> diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
> index ca67c8a..24491a9 100644
> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh
> @@ -8621,7 +8621,7 @@ EOF
>             if test "x$bindir" != x ;
>             then
>               func_relative_path "$install_libdir" "$bindir"
> -             tdlname=$func_relative_path_result$dlname
> +             tdlname=$func_relative_path_result/$dlname
>             else
>               # Otherwise fall back on heuristic.
>               tdlname=../bin/$dlname

This breaks if $func_relative_path_result is empty. Luckily I think
you fix that in the next commit (65f9e9a2 general.m4sh: relative path
to the same directory is `.'.), but between these two commits there
is brokenness.

This is just a note to future bisectors. :-)

Cheers,
Peter



reply via email to

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