bug-gnulib
[Top][All Lists]
Advanced

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

Re: bootstrap symlink dependencies


From: Pádraig Brady
Subject: Re: bootstrap symlink dependencies
Date: Mon, 16 May 2011 15:44:42 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 14/05/11 09:07, Paul Eggert wrote:
>> If something treats symlink mtime as significant,
>> then I suspect that it's at fault.
> 
> Yes, there's something busted there.  GNU 'make' does the right thing:
> it follows symlinks when checking time stamps.  Is some other 'make'
> is being used, or perhaps some tool other than 'make'?

I suspect something else in the depths of auto* is busted,
as I'm using standard make.

>> If we did want to maintain the symlink timestamps for some reason,
>> then I suppose we could do something like the following,
>> but I'm unsure as how to do this best portably.
> 
> We can use 'ls' rather than 'stat'.  Something like the following, perhaps?
> (I haven't tested it.)

I tested your ls ordering trick on linux, solaris 10 and freebsd and it works.
Please push.

thanks!
Pádraig.

> 
> diff --git a/build-aux/bootstrap b/build-aux/bootstrap
> index d32db57..b6dacb7 100755
> --- a/build-aux/bootstrap
> +++ b/build-aux/bootstrap
> @@ -670,10 +670,17 @@ symlink_to_dir()
>          cp -fp "$src" "$dst"
>        }
>      else
> +      # Leave any existing symlink alone, if it already points to the source,
> +      # so that broken 'make' implementations that care about symlink times
> +      # aren't confused into doing unnecessary builds.  Conversely, if the
> +      # existing symlink's time stamp is older than the source, make it 
> afresh,
> +      # so that broken 'make's aren't confused into skipping needed builds.
>        test -h "$dst" &&
>        src_ls=`ls -diL "$src" 2>/dev/null` && set $src_ls && src_i=$1 &&
>        dst_ls=`ls -diL "$dst" 2>/dev/null` && set $dst_ls && dst_i=$1 &&
> -      test "$src_i" = "$dst_i" || {
> +      test "$src_i" = "$dst_i" &&
> +      both_ls=`ls -dt "$src" "$dst"` &&
> +      test "X$both_ls" = "X$dst$nl$src" || {
>          dot_dots=
>          case $src in
>          /*) ;;



reply via email to

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