diff options
author | Thomas Bächler <thomas@archlinux.org> | 2011-02-27 12:17:18 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-02-27 12:17:18 +0100 |
commit | fcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4 (patch) | |
tree | 9aaed35d30833c12d96b9e851bb67171e92d4e11 | |
parent | fe843c397a42b3ae73615830392a65908ad7d973 (diff) | |
download | mkinitcpio-fcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4.tar.gz mkinitcpio-fcbc37fb7732c4b8a59ee0bfa8035ba8f81132e4.tar.xz |
Use in_array instead of grep -w when checking SKIPHOOKS.
This fixes FS#22821.
-rwxr-xr-x | mkinitcpio | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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 |