aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-04-04 16:23:21 +0200
committerPatrick Spek <p.spek@tyil.nl>2020-04-04 16:23:21 +0200
commit913566adaa414d764dc2b041d47a9206ac7c6d2e (patch)
treebb8faa0e49627e19e81e1975a80c606dbd7ba433
parentfcc5996afbbbc5717323452cc4448a9316346c48 (diff)
Add install support for Archlinux
-rw-r--r--etc/bindeps.d/linux-archlinux.txt2
-rw-r--r--etc/pacmans.txt5
-rw-r--r--lib/main.bash12
3 files changed, 15 insertions, 4 deletions
diff --git a/etc/bindeps.d/linux-archlinux.txt b/etc/bindeps.d/linux-archlinux.txt
new file mode 100644
index 0000000..6d60a0e
--- /dev/null
+++ b/etc/bindeps.d/linux-archlinux.txt
@@ -0,0 +1,2 @@
+gcc=gcc
+make=make
diff --git a/etc/pacmans.txt b/etc/pacmans.txt
index a4ea4bb..394a563 100644
--- a/etc/pacmans.txt
+++ b/etc/pacmans.txt
@@ -1,6 +1,7 @@
freebsd=pkg update && pkg install -y
+linux-alpine_linux=apk add --no-cache
+linux-archlinux=pacman -Sy --noconfirm
+linux-centos_linux=yum install -y
linux-debian_gnu_linux=apt update && apt install -y
linux-ubuntu=apt update && apt install -y
-linux-alpine_linux=apk add --no-cache
linux-void=xbps-install -Sy
-linux-centos_linux=yum install -y
diff --git a/lib/main.bash b/lib/main.bash
index 42164bc..c535ba5 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -206,7 +206,8 @@ discover_system() {
RSTAR_PLATFORM["arch"]="$(discover_system_arch)"
RSTAR_PLATFORM["version"]="$(discover_system_version)"
- if [[ ${RSTAR_PLATFORM[os]} == "linux" ]]
+ # When on a Linux-using OS, check for the specific distribution in use.
+ if [[ ${RSTAR_PLATFORM[os]} == *"linux"* ]]
then
RSTAR_PLATFORM["distro"]="$(discover_system_distro)"
fi
@@ -225,7 +226,14 @@ discover_system_distro() {
return
fi
- awk -F= '$1 == "NAME" {print tolower($2);q}' /etc/*release
+ crit "No /etc/os-release found. Are you sure you're on a sane GNU+Linux distribution?"
+
+ if command -v pacman > /dev/null
+ then
+ warn "Found pacman, assuming Archlinux as distro."
+ printf "%s" "archlinux"
+ return
+ fi
}
discover_system_version() {