diff options
Diffstat (limited to 'sysutils/screenfetch/patches/patch-screenfetch-dev')
-rw-r--r-- | sysutils/screenfetch/patches/patch-screenfetch-dev | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sysutils/screenfetch/patches/patch-screenfetch-dev b/sysutils/screenfetch/patches/patch-screenfetch-dev new file mode 100644 index 00000000000..a5f4556cca3 --- /dev/null +++ b/sysutils/screenfetch/patches/patch-screenfetch-dev @@ -0,0 +1,37 @@ +$NetBSD: patch-screenfetch-dev,v 1.1 2016/07/18 22:56:44 kamil Exp $ + +Cherry-pick upstream improvements for NetBSD. +"NetBSD: add package count, fix shell and cpu detection #300" + +-- https://patch-diff.githubusercontent.com/raw/KittyKatt/screenFetch/pull/300.patch + +--- screenfetch-dev.orig 2016-07-18 21:56:20.367098431 +0000 ++++ screenfetch-dev +@@ -877,6 +877,9 @@ detectpkgs () { + pkgs=$(if TMPDIR=/dev/null ASSUME_ALWAYS_YES=1 PACKAGESITE=file:///nonexistent pkg info pkg >/dev/null 2>&1; then + pkg info | wc -l | awk '{print $1}'; else pkg_info | wc -l | awk '{sub(" ", "");print $1}'; fi) + ;; ++ 'NetBSD') ++ pkgs=$(pkg_info | wc -l | tr -d ' ') ++ ;; + 'Cygwin') + cygfix=2 + pkgs=$(($(cygcheck -cd | wc -l) - ${cygfix})) +@@ -928,7 +931,7 @@ detectcpu () { + cpu="$cpu @ ${cpu_mhz}MHz" + fi + else +- cpu=$(awk 'BEGIN{FS=":"} /model name/ { print $2; exit }' /proc/cpuinfo | sed 's/ @/\n/' | head -1) ++ cpu=$(awk 'BEGIN{FS=":"} /model name/ { print $2; exit }' /proc/cpuinfo | awk 'BEGIN{FS=" @"; OFS="\n"} { print $1; exit }') + cpun=$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l) + if [ -z "$cpu" ]; then + cpu=$(awk 'BEGIN{FS=":"} /Hardware/ { print $2; exit }' /proc/cpuinfo) +@@ -1169,7 +1172,7 @@ detectshell () { + else + if [[ "${OSTYPE}" == "linux-gnu" || "${OSTYPE}" == "linux" ]]; then + shell_type=$(ps -p $PPID -o cmd --no-heading) +- elif [[ "${distro}" == "Mac OS X" || "${distro}" == "FreeBSD" || "${distro}" == "OpenBSD" ]]; then ++ elif [[ "${distro}" == "Mac OS X" || "${distro}" == "FreeBSD" || "${distro}" == "OpenBSD" || "${distro}" == "NetBSD" ]]; then + shell_type=$(ps -p $PPID -o args | tail -1) + else + shell_type=$(ps -p $(ps -p $PPID | awk '$1 !~ /PID/ {print $1}') | awk 'FNR>1 {print $1}') |