From faf06f17f427f5dbc239fb3d2114f19d70c693d3 Mon Sep 17 00:00:00 2001 From: q66 Date: Fri, 16 Aug 2019 15:19:20 +0200 Subject: xuname: use "platform" for cpu instead of "vendor_id" when missing Also provide a fallback when both are missing. Closes: #153 [via git-merge-pr] --- xuname | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xuname') diff --git a/xuname b/xuname index 8e06da4..8dbcf17 100755 --- a/xuname +++ b/xuname @@ -8,6 +8,7 @@ OUTDATED=$(xbps-install -Mun) HOLD=$(xbps-query -H) VM=$(dmesg 2>/dev/null | awk '/Hypervisor detected/{print $NF}') CPU=$(cat /proc/cpuinfo |awk '/^vendor_id/{print $NF;exit}') +[ -z "$CPU" ] && CPU=$(cat /proc/cpuinfo |awk '/^platform/{print $NF;exit}') REPO=$(xbps-query --regex -p repository -s '.' | cut -d/ -f2- | sort -u | awk ' /^\/alpha.de.repo.voidlinux.org\/current\/multilib/ {m=m"m"} /^\/alpha.de.repo.voidlinux.org\/current\/debug/ {d=d"d"} @@ -19,4 +20,4 @@ REPO=$(xbps-query --regex -p repository -s '.' | cut -d/ -f2- | sort -u | awk ' ') printf '%s %s %s %s %s%s %s\n' \ - "$OS" "$KVER" "$MACH" "$CPU${VM:+/$VM}" "${OUTDATED:+not}uptodate" "${HOLD:+ hold}" "$REPO" + "$OS" "$KVER" "$MACH" "${CPU:-Unknown}${VM:+/$VM}" "${OUTDATED:+not}uptodate" "${HOLD:+ hold}" "$REPO" -- cgit 1.4.1