From 0a7250a42092e9f1e70773ac7870d2e08c0b716d Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 7 May 2025 10:47:48 +0200 Subject: [PATCH] wip --- distros.sh | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/distros.sh b/distros.sh index eb19b7d..02bf734 100755 --- a/distros.sh +++ b/distros.sh @@ -70,25 +70,21 @@ get_packager() { ubuntu="true" distro="ubuntu" _install() { $_sudo apt-get install --assume-yes "$@"; } - silentexec $_sudo apt-get update ;; debian) debian="true" distro="debian" _install() { $_sudo apt-get install --assume-yes "$@"; } - silentexec $_sudo apt-get update ;; fedora) fedora="true" distro="fedora" _install() { $_sudo dnf install -y "$@"; } - silentexec $_sudo dnf update ;; alpine) alpine="true" distro="alpine" _install() { $_sudo apk add "$@"; } - silentexec $_sudo apk update ;; arch | manjaro | garuda | endeavour) arch="true" @@ -110,34 +106,28 @@ get_packager() { opensuse="true" distro="opensuse" _install() { $_sudo zypper in "$@"; } - silentexec $_sudo zypper ref ;; *) if [ "${ID_LIKE#*debian}" != "$ID_LIKE" ]; then debian="true" distro="debian" _install() { $_sudo apt-get install --assume-yes "$@"; } - silentexec $_sudo apt-get update elif [ "${ID_LIKE#*ubuntu}" != "$ID_LIKE" ]; then ubuntu="true" distro="ubuntu" _install() { $_sudo apt-get install --assume-yes "$@"; } - silentexec $_sudo apt-get update elif [ "${ID_LIKE#*arch}" != "$ID_LIKE" ]; then arch="true" distro="arch" _install() { $_sudo pacman -S --noconfirm "$@"; } - silentexec $_sudo pacman -Sy elif [ "${ID_LIKE#*fedora}" != "$ID_LIKE" ]; then fedora="true" distro="fedora" _install() { $_sudo dnf install -y "$@"; } - silentexec $_sudo dnf update elif [ "${ID_LIKE#*suse}" != "$ID_LIKE" ]; then opensuse="true" distro="opensuse" _install() { $_sudo zypper in "$@"; } - silentexec $_sudo zypper ref else echo_error "Unsupported distribution: $ID" exit 1 @@ -152,8 +142,8 @@ get_packager() { update_package_list() { case "$distro" in - ubuntu | debian) $_sudo apt-get update ;; - fedora) $_sudo dnf update ;; + ubuntu | debian) silentexec $_sudo apt-get update ;; + fedora) silentexec $_sudo dnf update ;; arch) if command_exists paru; then silentexec paru -Sy @@ -163,8 +153,8 @@ update_package_list() { silentexec $_sudo pacman -Sy fi ;; - opensuse) $_sudo zypper ref ;; - alpine) $_sudo apk update ;; + opensuse) silentexec $_sudo zypper ref ;; + alpine) silentexec $_sudo apk update ;; *) echo_error "Unsupported distribution: $distro" ;; esac }