[PATCH] install.sh: don't clobber dangling symlinks

Denys Vlasenko vda.linux at googlemail.com
Tue Jul 31 13:49:40 UTC 2018


Applied, thanks!

On Tue, Jul 17, 2018 at 12:40 PM, Baruch Siach <baruch at tkos.co.il> wrote:
> Symlinks in a subdirectory that is to become target rootfs are sometimes
> dangling because they link to canonical file names that are not present
> on the host, but are present relative to the target rootfs root. Don't
> copy over dangling symlinks when noclobber is enabled
>
> The -e test treats dangling symlinks as non-existent files. Add -h test
> that returns true for all symlinks.
>
> Cc: Yann E. MORIN <yann.morin.1998 at free.fr>
> Signed-off-by: Baruch Siach <baruch at tkos.co.il>
> ---
>  applets/install.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/applets/install.sh b/applets/install.sh
> index 9aede0f530e2..415896893e86 100755
> --- a/applets/install.sh
> +++ b/applets/install.sh
> @@ -83,7 +83,7 @@ install -m 755 busybox "$prefix/bin/busybox" || exit 1
>  for i in $h; do
>         appdir=`dirname "$i"`
>         app=`basename "$i"`
> -       if [ x"$noclobber" = x"1" ] && [ -e "$prefix/$i" ]; then
> +       if [ x"$noclobber" = x"1" ] && ([ -e "$prefix/$i" ] || [ -h "$prefix/$i" ]); then
>                 echo "  $prefix/$i already exists"
>                 continue
>         fi
> --
> 2.18.0
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list