Switch from if -> case for BSD package counts

Signed-off-by: Adam Jimerson <vendion@gmail.com>
This commit is contained in:
Adam Jimerson 2016-08-11 06:48:34 -04:00
parent 01ce345c33
commit f310d757d4

View file

@ -695,16 +695,18 @@ getpackages () {
;; ;;
"BSD") "BSD")
case "$distro" in
# PacBSD has both pacman and pkg, but only pacman is used # PacBSD has both pacman and pkg, but only pacman is used
if [[ "$distro" == "PacBSD"* ]]; then "PacBSD"*) packages="$(pacman -Qq --color never | wc -l)" ;;
packages="$(pacman -Qq --color never | wc -l)"
else *)
if type -p pkg_info >/dev/null 2>&1; then if type -p pkg_info >/dev/null 2>&1; then
packages="$(pkg_info | wc -l)" packages="$(pkg_info | wc -l)"
elif type -p pkg >/dev/null 2>&1; then elif type -p pkg >/dev/null 2>&1; then
packages="$(pkg info | wc -l)" packages="$(pkg info | wc -l)"
fi fi
fi ;;
esac
;; ;;
"Windows") "Windows")