Permalink
Browse files

!bug: a bad typo (FUNC_NAME -> FUNCNAME)

$FUNCNAME is a Bash variable, that presents the current function
name. In our case, it is "_OSTYPE_detect". (I hope that the binary
"pacman" will not have this string.)

Ok, bug yields another bug. By using FUNC_NAME, the :grep will
always return true, and there is still a loop.

Thanks to :Severus and :kitarousa for your time ;)

FIXME: use Bash -e
FIXME: provide tests for :pacapt
  • Loading branch information...
icy committed Apr 18, 2014
1 parent 57aca9e commit 0d6b771942917d9f34fb1b44cc99b024b19dc492
Showing with 1 addition and 1 deletion.
  1. +1 −1 pacapt
2 pacapt
@@ -194,7 +194,7 @@ _OSTYPE_detect() {
if [[ -x "/usr/bin/pacman" ]]; then
# This is to prevent a loop when this script is installed on
# non-standard system
grep -q "$FUNC_NAME" '/usr/bin/pacman' >/dev/null 2>&1
grep -q "$FUNCNAME" '/usr/bin/pacman' >/dev/null 2>&1
[[ $? -ge 1 ]] && _OSTYPE="PACMAN" && return
fi
[[ -x "/usr/bin/apt-get" ]] && _OSTYPE="DPKG" && return

0 comments on commit 0d6b771

Please sign in to comment.