Packages: Merged Linux and BSD package detection
This commit is contained in:
parent
7726133333
commit
5f48a04bda
1 changed files with 5 additions and 16 deletions
21
neofetch
21
neofetch
|
@ -394,7 +394,7 @@ get_packages() {
|
|||
local PATH="${PATH#:}"
|
||||
|
||||
case "$os" in
|
||||
"Linux" | "iPhone OS" | "Solaris")
|
||||
"Linux" | "BSD" | "iPhone OS" | "Solaris")
|
||||
type -p pacman >/dev/null && \
|
||||
packages="$(pacman -Qq --color never | wc -l)"
|
||||
|
||||
|
@ -446,8 +446,12 @@ get_packages() {
|
|||
type -p eopkg >/dev/null && \
|
||||
packages="$((packages+=$(eopkg list-installed | wc -l)))"
|
||||
|
||||
type -p pkg_info >/dev/null && \
|
||||
packages="$((packages+=$(pkg_info | wc -l)))"
|
||||
|
||||
if type -p pkg >/dev/null; then
|
||||
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
|
||||
(("$packages" == "0")) && packages="$((packages+=$(pkg info | wc -l)))"
|
||||
(("$packages" == "0")) && packages="$((packages+=$(pkg list | wc -l)))"
|
||||
fi
|
||||
;;
|
||||
|
@ -466,21 +470,6 @@ get_packages() {
|
|||
packages="$((packages + $(pkgin list | wc -l)))"
|
||||
;;
|
||||
|
||||
"BSD")
|
||||
case "$distro" in
|
||||
# PacBSD has both pacman and pkg, but only pacman is used.
|
||||
"PacBSD"*) packages="$(pacman -Qq --color never | wc -l)" ;;
|
||||
|
||||
*)
|
||||
if type -p pkg_info >/dev/null; then
|
||||
packages="$(pkg_info | wc -l)"
|
||||
elif type -p pkg >/dev/null; then
|
||||
packages="$(pkg info | wc -l)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
packages="$(cygcheck -cd | wc -l)"
|
||||
|
||||
|
|
Loading…
Reference in a new issue