From aad629e3c0b741b52c487b92fd2700e2ad33940a Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 11 May 2025 14:39:42 +0200 Subject: [PATCH] wip --- distros.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/distros.sh b/distros.sh index bdf2035..2d5ef86 100755 --- a/distros.sh +++ b/distros.sh @@ -38,10 +38,19 @@ echo_note() { command_exists() { command -v "$@" >/dev/null 2>&1 } + silentexec() { "$@" >/dev/null 2>&1 } +run() { + if $silent; then + silentexec "$@" + else + "$@" + fi +} + checkAndInstall() { for deps in "$@"; do if ! command_exists $deps; then @@ -84,16 +93,32 @@ get_packager() { ubuntu="true" distro="ubuntu" _install() { $_sudo apt-get install --assume-yes "$@"; } + # Codename support + case "$VERSION_CODENAME" in + noble) noble=true ;; + jammy) jammy=true ;; + focal) focal=true ;; + bionic) bionic=true ;; + esac ;; debian | kali | linuxmint | elementary | neon | kdeneon | deepin) debian="true" distro="debian" _install() { $_sudo apt-get install --assume-yes "$@"; } + case "$VERSION_CODENAME" in + trixie) trixie=true ;; + bookworm) bookworm=true ;; + bullseye) bullseye=true ;; + buster) buster=true ;; + esac ;; fedora | centos | rhel | rocky | almalinux) fedora="true" distro="fedora" _install() { $_sudo dnf install -y "$@"; } + # Add version-specific var like: fedora_40=true + fedora_version="fedora_${VERSION_ID//./_}" + eval "$fedora_version=true" ;; alpine) alpine="true"