bug-gnulib
[Top][All Lists]
Advanced

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

Re: bootstrap: clean only gnulib's stray links


From: Jim Meyering
Subject: Re: bootstrap: clean only gnulib's stray links
Date: Tue, 1 Jan 2019 21:27:10 -0800

On Mon, Dec 31, 2018 at 11:25 PM Akim Demaille <address@hidden> wrote:
...
> In Bison we have another submodule, and symlinks pointing
> into.  Occasionally, some users launch ./bootstrap before having
> initialized the submodules, in which case the symlink is removed
> by bootstrap.  When this happens, it takes quite a few interaction
> with the user to understand what went wrong (see for instance
>
> https://lists.gnu.org/archive/html/help-bison/2018-12/msg00034.html
>
> and
>
> https://lists.gnu.org/archive/html/bug-bison/2011-05/msg00012.html
>
> This commit restricts this dandling symlink cleaning to those
> going into gnulib.
>
> Cheers, and happy new year!
>
>
> commit bf316bfa3de7cfe7af948ba2ff84f44c252c4c01
> Author: Akim Demaille <address@hidden>
> Date:   Mon Dec 31 19:20:46 2018 +0100
>
>     bootstrap: clean only gnulib's stray links
>
>     * build-aux/bootstrap: Remove only dangling links pointing into
>     gnulib.
>
> diff --git a/ChangeLog b/ChangeLog
> index 406e08327..5a1971983 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2019-01-01  Akim Demaille  <address@hidden>
> +
> +       bootstrap: clean only gnulib's stray links
> +       * build-aux/bootstrap: Remove only dangling links pointing into
> +       gnulib.
> +
>  2018-12-27  Paul Eggert  <address@hidden>
>
>         mkfifo: bring back HAVE_MKFIFO macro
> diff --git a/build-aux/bootstrap b/build-aux/bootstrap
> index 5264d9f1e..45061733b 100755
> --- a/build-aux/bootstrap
> +++ b/build-aux/bootstrap
> @@ -1,6 +1,6 @@
>  #! /bin/sh
>  # Print a version string.
> -scriptversion=2018-10-13.05; # UTC
> +scriptversion=2019-01-01.06; # UTC
>
>  # Bootstrap this package from checked-out sources.
>
> @@ -963,7 +963,7 @@ fi
>  bootstrap_post_import_hook \
>    || die "bootstrap_post_import_hook failed"
>
> -# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
> +# Remove any dangling symlink into gnulib/ matching "*.m4" or "*.[ch]" in 
> some
>  # gnulib-populated directories.  Such .m4 files would cause aclocal to fail.
>  # The following requires GNU find 4.2.3 or newer.  Considering the usual
>  # portability constraints of this script, that may seem a very demanding
> @@ -973,7 +973,15 @@ bootstrap_post_import_hook \
>  # between successive runs of this script.
>  find "$m4_base" "$source_base" \
>    -depth \( -name '*.m4' -o -name '*.[ch]' \) \
> -  -type l -xtype l -delete > /dev/null 2>&1
> +  -type l -xtype l 2>/dev/null |
> +    while read l
> +    do
> +      case `readlink "$l"` in
> +        "`pwd`/$gnulib_path"/*)
> +          echo "$me: rm -f $l"
> +          rm -f "$l";;
...
Hi Akim,

My only concern is that `pwd` may sometimes fail to match the link
name when it should. E.g., when mount points or directory symlinks are
involved.

Instead, can you simply make the bootstrap script fail when the
submodules are not initialized?

Happy new year :-)



reply via email to

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