aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-04-01 11:30:24 +0200
committerPatrick Spek <p.spek@tyil.nl>2020-04-01 11:30:24 +0200
commitac777211fdd1a5556097a9856389dc34f5356706 (patch)
tree53c44009b21dea972ac92f0c76c3b166f1ecd19b
parent7b024443649425975219925a9b7ff75ab1768782 (diff)
Update sysinfo to only use POSIX specified uname info
-rw-r--r--etc/bindeps.d/linux-ubuntu.txt (renamed from etc/bindeps.d/gnu_linux-ubuntu.txt)0
-rw-r--r--etc/pacmans.txt2
-rw-r--r--etc/perlmans.txt2
-rw-r--r--lib/main.bash18
4 files changed, 11 insertions, 11 deletions
diff --git a/etc/bindeps.d/gnu_linux-ubuntu.txt b/etc/bindeps.d/linux-ubuntu.txt
index 6d60a0e..6d60a0e 100644
--- a/etc/bindeps.d/gnu_linux-ubuntu.txt
+++ b/etc/bindeps.d/linux-ubuntu.txt
diff --git a/etc/pacmans.txt b/etc/pacmans.txt
index 660ae51..7657f7f 100644
--- a/etc/pacmans.txt
+++ b/etc/pacmans.txt
@@ -1,2 +1,2 @@
-gnu_linux-ubuntu=apt update && apt install -y
+linux-ubuntu=apt update && apt install -y
freebsd=pkg update && pkg install -y
diff --git a/etc/perlmans.txt b/etc/perlmans.txt
index 9ffbacc..1ea6f65 100644
--- a/etc/perlmans.txt
+++ b/etc/perlmans.txt
@@ -1 +1 @@
-gnu_linux-ubuntu=apt install -y cpanminus && cpanm -v
+linux-ubuntu=apt install -y cpanminus && cpanm -v
diff --git a/lib/main.bash b/lib/main.bash
index a06c003..a5aaa6c 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -200,17 +200,21 @@ depcheck_perl() {
# sysinfo command in their message to you.
discover_system() {
RSTAR_PLATFORM["os"]="$(discover_system_os)"
+ RSTAR_PLATFORM["arch"]="$(discover_system_arch)"
+ RSTAR_PLATFORM["version"]="$(discover_system_version)"
- if [[ ${RSTAR_PLATFORM[os]} == "gnu_linux" ]]
+ if [[ ${RSTAR_PLATFORM[os]} == "linux" ]]
then
RSTAR_PLATFORM["distro"]="$(discover_system_distro)"
- RSTAR_PLATFORM["kernel"]="$(discover_system_kernel)"
- RSTAR_PLATFORM["kernel_version"]="$(discover_system_kernel_version)"
fi
RSTAR_PLATFORM[key]="$(discover_system_key)"
}
+discover_system_arch() {
+ uname -m
+}
+
discover_system_distro() {
if [[ -f /etc/os-release ]]
then
@@ -221,11 +225,7 @@ discover_system_distro() {
awk -F= '$1 == "NAME" {print tolower($2);q}' /etc/*release
}
-discover_system_kernel() {
- printf "%s" "$(uname -s | awk '{print tolower($0)}')"
-}
-
-discover_system_kernel_version() {
+discover_system_version() {
printf "%s" "$(uname -r | awk '{print tolower($0)}')"
}
@@ -243,7 +243,7 @@ discover_system_key() {
discover_system_os() {
if command -v uname > /dev/null
then
- printf "%s" "$(uname -o | awk '{print tolower($0)}' | sed 's_[/+]_\__g')"
+ printf "%s" "$(uname -s | awk '{print tolower($0)}' | sed 's_[/+]_\__g')"
return
fi
}