aboutsummaryrefslogtreecommitdiff
path: root/applets
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-02-23 16:29:26 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-02-23 16:29:26 +0100
commitbf39d97e9d9422537970ed8c3af1b8270bdf0ac0 (patch)
treeb16430a145b2f8c039e5edec5cb2ba5d6c912a8e /applets
parent3177626033fa58fcb60e29009936f08f16e6a99c (diff)
downloadbusybox-bf39d97e9d9422537970ed8c3af1b8270bdf0ac0.tar.gz
Fix install with hardlinks and a custom PREFIX. Closes 10801
Trying to install busybox with hardlinks and a custom PREFIX will fail for applets not in the /bin directory, because relative pathnames are used. applets/install.sh is *supposed to* use the absolute pathname for hardlinks but it fails to do so because the wrong check is used in the if statement. While fixing it, shore up other sloppy coding in applets/install.sh Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'applets')
-rwxr-xr-xapplets/install.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/applets/install.sh b/applets/install.sh
index ae99381d7..c75a78e9d 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -38,7 +38,7 @@ while [ ${#} -gt 0 ]; do
shift
done
-if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
+if [ -n "$DO_INSTALL_LIBS" ] && [ x"$DO_INSTALL_LIBS" != x"n" ]; then
# get the target dir for the libs
# assume it starts with lib
libdir=$($CC -print-file-name=libc.so | \
@@ -58,7 +58,7 @@ if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
done
fi
-if [ "$cleanup" = "1" ] && [ -e "$prefix/bin/busybox" ]; then
+if [ x"$cleanup" = x"1" ] && [ -e "$prefix/bin/busybox" ]; then
inode=`ls -i "$prefix/bin/busybox" | awk '{print $1}'`
sub_shell_it=`
cd "$prefix"
@@ -81,13 +81,13 @@ 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
+ if [ x"$noclobber" = x"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
+ if [ x"$scriptwrapper" = x"y" ]; then
+ if [ x"$swrapall" != x"y" ] && [ x"$i" = x"/bin/sh" ]; then
ln $linkopts busybox "$prefix/$i" || exit 1
else
rm -f "$prefix/$i"
@@ -95,17 +95,17 @@ for i in $h; do
chmod +x "$prefix/$i"
fi
echo " $prefix/$i"
- elif [ "$binaries" = "y" ]; then
+ elif [ x"$binaries" = x"y" ]; then
# Copy the binary over rather
- if [ -e $sharedlib_dir/$app ]; then
+ if [ -e "$sharedlib_dir/$app" ]; then
echo " Copying $sharedlib_dir/$app to $prefix/$i"
- cp -pPR $sharedlib_dir/$app $prefix/$i || exit 1
+ cp -pPR "$sharedlib_dir/$app" "$prefix/$i" || exit 1
else
echo "Error: Could not find $sharedlib_dir/$app"
exit 1
fi
else
- if [ "$2" = "--hardlinks" ]; then
+ if [ x"$linkopts" = x"-f" ]; then
bb_path="$prefix/bin/busybox"
else
case "$appdir" in