@@ -404,7 +404,7 @@ function private_should_cast()
# order is important here...
if ! codex_does_spell_exist $1; then
return 1
- elif echo "$PRETEND_NOT_INSTALLED" | grep -x -q "$1" ; then
+ elif echo "$PRETEND_NOT_INSTALLED" | grep -q " $1 " ; then
# always look at stuff on the command line unless its exiled
return 0
# from here on the spell was not on the command line...
@@ -691,7 +691,7 @@ function work_depends_provider()
# check if we've already answered this question
if [[ ! $default ]]; then
for tmp in $CANDIDATES; do
- echo ${spells[@]} | tr " " "\n"| grep -x -q "$tmp" && default=$tmp &&
break
+ echo " ${spells[@]} " | grep -q " $tmp " && default=$tmp && break
done
fi
@@ -799,7 +799,7 @@ function work_optional_depends_provider()
# check if we've already answered this question
if [[ ! $default ]]; then
for tmp in $CANDIDATES; do
- echo ${spells[@]} | tr " " "\n" | grep -x -q "$tmp" && default=$tmp &&
break
+ echo " ${spells[@]} " | grep -q " $tmp " && default=$tmp && break
done
fi
@@ -892,8 +892,7 @@ function work_optional_depends_spell()
# check the install queue
if [[ ! $default ]]; then
debug "libdepends" "Checking in queue"
- #\< and \> match the empty string at the start and end of a word
- echo ${spells[@]}|tr " " "\n" | grep -x -q "$1" && default=on
+ echo " ${spells[@]} " | grep -q " $1 " && default=on
fi
# check if installed/held
@@ -1017,7 +1016,7 @@ function private_up_trigger() {
# afk 6-7-06 Im not sure this line is correct, it seems to only
# make a circular depends, instead we want $TARGET to depend on $SPELL
- echo ${NEW_DEPENDS[@]} |tr " " "\n"| grep -x -q "$TARGET" ||
+ echo " ${NEW_DEPENDS[@]} " | grep -q " $TARGET " ||
NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell)
triggerees=( ${triggerees[*]} $TARGET )
[SM-Commit] GIT changes to test-1.13 sorcery by Jaka Kranjc (61345e62d0b761ef6d808b360dc13ed6e838f8d2),
Jaka Kranjc, 01/05/2008