summaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorYann E. MORIN2017-12-28 23:49:47 +0100
committerDenys Vlasenko2018-01-04 14:36:17 +0100
commit84be5ce0d814780918771727e494fe4a2eb46636 (patch)
treeca369aa8c61a428294994fdc88934f27dd66c245 /applets
parenta034cab0952bcb93cfbe8b2a333c59615dfa7e90 (diff)
downloadbusybox-84be5ce0d814780918771727e494fe4a2eb46636.zip
busybox-84be5ce0d814780918771727e494fe4a2eb46636.tar.gz
applets/install: respect noclobber for script wrappers too
Simplify the handling of --noclobber so that it applies to all types of installation types, even to script wrappers. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets')
-rwxr-xr-xapplets/install.sh20
1 files changed, 8 insertions, 12 deletions
diff --git a/applets/install.sh b/applets/install.sh
index f6c097e..4b70df9 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -77,6 +77,10 @@ install -m 755 busybox "$prefix/bin/busybox" || exit 1
for i in $h; do
appdir=`dirname "$i"`
app=`basename "$i"`
+ if [ "$noclobber" = "1" ] && [ -e "$prefix/$i" ]; then
+ echo " $prefix/$i already exists"
+ continue
+ fi
mkdir -p "$prefix/$appdir" || exit 1
if [ "$scriptwrapper" = "y" ]; then
if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then
@@ -90,12 +94,8 @@ for i in $h; do
elif [ "$binaries" = "y" ]; then
# Copy the binary over rather
if [ -e $sharedlib_dir/$app ]; then
- if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then
- echo " Copying $sharedlib_dir/$app to $prefix/$i"
- cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
- else
- echo " $prefix/$i already exists"
- fi
+ echo " Copying $sharedlib_dir/$app to $prefix/$i"
+ cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
else
echo "Error: Could not find $sharedlib_dir/$app"
exit 1
@@ -123,12 +123,8 @@ for i in $h; do
;;
esac
fi
- if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then
- echo " $prefix/$i -> $bb_path"
- ln $linkopts "$bb_path" "$prefix/$i" || exit 1
- else
- echo " $prefix/$i already exists"
- fi
+ echo " $prefix/$i -> $bb_path"
+ ln $linkopts "$bb_path" "$prefix/$i" || exit 1
fi
done