only call uname -m once, might fix awk

This commit is contained in:
Andrew Titmuss 2016-05-08 13:46:19 +10:00
parent 3376a7d697
commit 94430374cb
No known key found for this signature in database
GPG Key ID: ECA4FAA2A0C75A68
1 changed files with 4 additions and 3 deletions

View File

@ -502,6 +502,7 @@ getdistro () {
"iPhone OS")
distro="iOS $(sw_vers -productVersion)"
idevice="$(uname -m)"
# "uname -m" doesn't print architecture on iOS so we force it off.
os_arch="off"
@ -951,8 +952,8 @@ getcpu () {
;;
"iPhone OS")
cpu="$(awk -F '|' '/$(uname -m)/ {printf $2}' idevicehw.csv)"
cores="$(awk -F '|' '/$(uname -m)/ {printf $3}' idevicehw.csv)"
cpu="$(awk -F '|' '/$idevice/ {printf $2}' idevicehw.csv)"
cores="$(awk -F '|' '/$idevice/ {printf $3}' idevicehw.csv)"
;;
*)
@ -1167,7 +1168,7 @@ getgpu () {
;;
"iPhone OS")
gpu="$(awk -F '|' '/$(uname -m)/ {printf $4}' idevicehw.csv)"
gpu="$(awk -F '|' '/$idevice/ {printf $4}' idevicehw.csv)"
;;
*"BSD")