aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-12-28 23:49:47 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-01-04 14:36:17 +0100
commit84be5ce0d814780918771727e494fe4a2eb46636 (patch)
treeca369aa8c61a428294994fdc88934f27dd66c245
parenta034cab0952bcb93cfbe8b2a333c59615dfa7e90 (diff)
downloadbusybox-w32-84be5ce0d814780918771727e494fe4a2eb46636.tar.gz
busybox-w32-84be5ce0d814780918771727e494fe4a2eb46636.tar.bz2
busybox-w32-84be5ce0d814780918771727e494fe4a2eb46636.zip
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>
-rwxr-xr-xapplets/install.sh20
1 files changed, 8 insertions, 12 deletions
diff --git a/applets/install.sh b/applets/install.sh
index f6c097e57..4b70df96e 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -77,6 +77,10 @@ install -m 755 busybox "$prefix/bin/busybox" || exit 1
77for i in $h; do 77for i in $h; do
78 appdir=`dirname "$i"` 78 appdir=`dirname "$i"`
79 app=`basename "$i"` 79 app=`basename "$i"`
80 if [ "$noclobber" = "1" ] && [ -e "$prefix/$i" ]; then
81 echo " $prefix/$i already exists"
82 continue
83 fi
80 mkdir -p "$prefix/$appdir" || exit 1 84 mkdir -p "$prefix/$appdir" || exit 1
81 if [ "$scriptwrapper" = "y" ]; then 85 if [ "$scriptwrapper" = "y" ]; then
82 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then 86 if [ "$swrapall" != "y" ] && [ "$i" = "/bin/sh" ]; then
@@ -90,12 +94,8 @@ for i in $h; do
90 elif [ "$binaries" = "y" ]; then 94 elif [ "$binaries" = "y" ]; then
91 # Copy the binary over rather 95 # Copy the binary over rather
92 if [ -e $sharedlib_dir/$app ]; then 96 if [ -e $sharedlib_dir/$app ]; then
93 if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then 97 echo " Copying $sharedlib_dir/$app to $prefix/$i"
94 echo " Copying $sharedlib_dir/$app to $prefix/$i" 98 cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
95 cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
96 else
97 echo " $prefix/$i already exists"
98 fi
99 else 99 else
100 echo "Error: Could not find $sharedlib_dir/$app" 100 echo "Error: Could not find $sharedlib_dir/$app"
101 exit 1 101 exit 1
@@ -123,12 +123,8 @@ for i in $h; do
123 ;; 123 ;;
124 esac 124 esac
125 fi 125 fi
126 if [ "$noclobber" = "0" ] || [ ! -e "$prefix/$i" ]; then 126 echo " $prefix/$i -> $bb_path"
127 echo " $prefix/$i -> $bb_path" 127 ln $linkopts "$bb_path" "$prefix/$i" || exit 1
128 ln $linkopts "$bb_path" "$prefix/$i" || exit 1
129 else
130 echo " $prefix/$i already exists"
131 fi
132 fi 128 fi
133done 129done
134 130