[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH 2/3] applets/install: accept more than one install option
From: "Yann E. MORIN" <yann.morin.1998 () free ! fr>
Date: 2017-12-28 22:49:48
Message-ID: 94b1c3dd461e71a667468888c29ed66163a444e6.1514501354.git.yann.morin.1998 () free ! fr
[Download RAW message or body]
Currently, it is impossible to pass more than one option to the isntall
script, so it totally prevents using --noclobber.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
applets/install.sh | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/applets/install.sh b/applets/install.sh
index 4b70df96e..1e621e4c4 100755
--- a/applets/install.sh
+++ b/applets/install.sh
@@ -8,6 +8,7 @@ if [ -z "$prefix" ]; then
echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--binaries/--scriptwrapper]"
exit 1
fi
+shift # Keep only remaining options
# Source the configuration
. ./.config
@@ -21,18 +22,21 @@ scriptwrapper="n"
binaries="n"
cleanup="0"
noclobber="0"
-case "$2" in
- --hardlinks) linkopts="-f";;
- --symlinks) linkopts="-fs";;
- --binaries) binaries="y";;
- --scriptwrapper) scriptwrapper="y";swrapall="y";;
- --sw-sh-hard) scriptwrapper="y";linkopts="-f";;
- --sw-sh-sym) scriptwrapper="y";linkopts="-fs";;
- --cleanup) cleanup="1";;
- --noclobber) noclobber="1";;
- "") h="";;
- *) echo "Unknown install option: $2"; exit 1;;
-esac
+while [ ${#} -gt 0 ]; do
+ case "$1" in
+ --hardlinks) linkopts="-f";;
+ --symlinks) linkopts="-fs";;
+ --binaries) binaries="y";;
+ --scriptwrapper) scriptwrapper="y";swrapall="y";;
+ --sw-sh-hard) scriptwrapper="y";linkopts="-f";;
+ --sw-sh-sym) scriptwrapper="y";linkopts="-fs";;
+ --cleanup) cleanup="1";;
+ --noclobber) noclobber="1";;
+ "") h="";;
+ *) echo "Unknown install option: $1"; exit 1;;
+ esac
+ shift
+done
if [ -n "$DO_INSTALL_LIBS" ] && [ "$DO_INSTALL_LIBS" != "n" ]; then
# get the target dir for the libs
--
2.11.0
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic