summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-02-27 12:17:18 +0100
committerThomas Bächler <thomas@archlinux.org>2011-02-27 12:17:18 +0100
commitfcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4 (patch)
tree9aaed35d30833c12d96b9e851bb67171e92d4e11
parentfe843c397a42b3ae73615830392a65908ad7d973 (diff)
downloadmkinitcpio-fcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4.tar.gz
mkinitcpio-fcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4.tar.xz
Use in_array instead of grep -w when checking SKIPHOOKS.
This fixes FS#22821.
-rwxr-xr-xmkinitcpio11
1 files changed, 8 insertions, 3 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 2397776..b4497e2 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -27,7 +27,7 @@ GENIMG=""
APPEND=""
PRESET=""
MESSAGE=""
-SKIPHOOKS=""
+SKIPHOOKS=()
PRESETDIR="mkinitcpio.d"
QUIET="y"
SHOW_AUTOMODS="n"
@@ -92,7 +92,12 @@ while getopts ':c:k:s:b:g:a:p:m:vH:LMhS:' arg; do
p) PRESET="${OPTARG}" ;;
m) MESSAGE="${OPTARG}" ;;
v) QUIET="n" ;;
- S) SKIPHOOKS="${OPTARG}" ;;
+ S) OLDIFS=${IFS}
+ IFS=,
+ SKIPHOOKS=(${OPTARG})
+ IFS=${OLDIFS}
+ unset OLDIFS
+ ;;
H) . "${INSTDIR}/${OPTARG}";
echo "Help for hook '${OPTARG}':"
help
@@ -232,7 +237,7 @@ fi
parse_hook
for hook in ${HOOKS}; do
- echo "${SKIPHOOKS}" | grep -qw ${hook} && continue
+ in_array ${hook} ${SKIPHOOKS[@]} && continue
unset MODULES
unset BINARIES
unset FILES