Packages: Separate FreeBSD pkg from Linux/Solaris pkg detection

This commit is contained in:
Muhammad Herdiansyah 2016-12-18 11:52:09 +07:00
parent 5f48a04bda
commit 2bad735fb3

View file

@ -450,9 +450,12 @@ get_packages() {
packages="$((packages+=$(pkg_info | wc -l)))" packages="$((packages+=$(pkg_info | wc -l)))"
if type -p pkg >/dev/null; then if type -p pkg >/dev/null; then
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))" case "$kernel_name" in
(("$packages" == "0")) && packages="$((packages+=$(pkg info | wc -l)))" "FreeBSD") packages="$((packages+=$(pkg info | wc -l)))" ;;
(("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))" *)
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
(("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))"
esac
fi fi
;; ;;