This commit is contained in:
Dylan Araps 2016-10-24 08:49:41 +11:00
commit 1993f22ec6

View file

@ -233,6 +233,7 @@ getdistro() {
"on" | "tiny") distro="$(awk 'NR==1{print $1 " " $2;}' /etc/release)" ;; "on" | "tiny") distro="$(awk 'NR==1{print $1 " " $2;}' /etc/release)" ;;
*) distro="$(awk 'NR==1{print $1 " " $2 " " $3;}' /etc/release)" ;; *) distro="$(awk 'NR==1{print $1 " " $2 " " $3;}' /etc/release)" ;;
esac esac
distro="${distro/\(*}"
;; ;;
esac esac
@ -343,7 +344,7 @@ getuptime() {
getpackages() { getpackages() {
case "$os" in case "$os" in
"Linux" | "iPhone OS") "Linux" | "iPhone OS" | "Solaris")
type -p pacman >/dev/null 2>&1 && \ type -p pacman >/dev/null 2>&1 && \
packages="$(pacman -Qq --color never | wc -l)" packages="$(pacman -Qq --color never | wc -l)"
@ -367,6 +368,7 @@ getpackages() {
type -p pkg >/dev/null 2>&1 && \ type -p pkg >/dev/null 2>&1 && \
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))" packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
[ "$packages" == "0" ] && packages="$((packages+=$(pkg list | wc -l)))"
type -p emerge >/dev/null 2>&1 && \ type -p emerge >/dev/null 2>&1 && \
packages="$((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))" packages="$((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))"
@ -426,10 +428,6 @@ getpackages() {
[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ] && \ [ -d "/cygdrive/c/ProgramData/chocolatey/lib" ] && \
packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))" packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))"
;; ;;
"Solaris")
packages="$(pkg list | wc -l)"
;;
esac esac
} }