diff options
author | Baruch Siach <baruch@tkos.co.il> | 2018-07-17 13:40:45 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-07-31 15:49:19 +0200 |
commit | 3d07446cef196c8c6f92a4d8006a56d348fca062 (patch) | |
tree | ecea43b103953e246b73621a99411f2ee17d202c /applets | |
parent | e8073519d8d851d5f7e7c1fde8c9b9e65c4ab458 (diff) |
install.sh: don't clobber dangling symlinks
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@free.fr>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets')
-rwxr-xr-x | applets/install.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/applets/install.sh b/applets/install.sh index 9aede0f53..415896893 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 |