applets/install: don't try to install nothing
authorYann E. MORIN <yann.morin.1998@free.fr>
Sun, 15 Apr 2018 08:55:30 +0000 (10:55 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 15 Apr 2018 10:07:22 +0000 (12:07 +0200)
Commit 952d5a6024e7 (applets/install: accept more than one install
option) changed the way we handle install options: before that commit, a
missing install type would mean to install nothing; after, we would
iterate over options, so we would never notice there was a mising
option.

Fix that by introducing an explicit --none option to specify to install
nothing.

Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Makefile.custom
applets/install.sh

index 28d0ef7bc0b2e6c4503939d5a5a9a54e82ab17ca..6f679c4e12b4cb7bc139104aa321f035db387261 100644 (file)
@@ -11,6 +11,9 @@ busybox.cfg.nosuid: $(srctree)/applets/busybox.mksuid $(objtree)/include/autocon
        $(Q)-SUID="DROP" $(SHELL) $^ > $@
 
 .PHONY: install
+ifeq ($(CONFIG_INSTALL_APPLET_DONT),y)
+INSTALL_OPTS:= --none
+endif
 ifeq ($(CONFIG_INSTALL_APPLET_SYMLINKS),y)
 INSTALL_OPTS:= --symlinks
 endif
index c75a78e9d12d8131b925f881341885c7da3e9393..9aede0f530e277f7abe3e646f45bb31623361bf7 100755 (executable)
@@ -5,7 +5,9 @@ export LC_CTYPE=POSIX
 
 prefix=$1
 if [ -z "$prefix" ]; then
-       echo "usage: applets/install.sh DESTINATION [--symlinks/--hardlinks/--binaries/--scriptwrapper]"
+       echo "usage: applets/install.sh DESTINATION TYPE [OPTS ...]"
+       echo "  TYPE is one of: --symlinks --hardlinks --binaries --scriptwrapper --none"
+       echo "  OPTS is one or more of: --cleanup --noclobber"
        exit 1
 fi
 shift # Keep only remaining options
@@ -32,7 +34,7 @@ while [ ${#} -gt 0 ]; do
                --sw-sh-sym)     scriptwrapper="y"; linkopts="-fs";;
                --cleanup)       cleanup="1";;
                --noclobber)     noclobber="1";;
-               "")              h="";;
+               --none)          h="";;
                *)               echo "Unknown install option: $1"; exit 1;;
        esac
        shift