From 913566adaa414d764dc2b041d47a9206ac7c6d2e Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Sat, 4 Apr 2020 16:23:21 +0200 Subject: Add install support for Archlinux --- etc/bindeps.d/linux-archlinux.txt | 2 ++ etc/pacmans.txt | 5 +++-- lib/main.bash | 12 ++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 etc/bindeps.d/linux-archlinux.txt 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() { -- cgit v1.1