Merge pull request #393 from konimex/master

Solaris: Changed Solaris' getpackage behaviour and getdistro output
This commit is contained in:
Dylan Araps 2016-10-23 22:56:49 +11:00 committed by GitHub
commit 4fadf10a92
1 changed files with 3 additions and 5 deletions

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
} }