wip
This commit is contained in:
parent
007468e5b8
commit
0a7250a420
1 changed files with 4 additions and 14 deletions
18
distros.sh
18
distros.sh
|
@ -70,25 +70,21 @@ get_packager() {
|
||||||
ubuntu="true"
|
ubuntu="true"
|
||||||
distro="ubuntu"
|
distro="ubuntu"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
silentexec $_sudo apt-get update
|
|
||||||
;;
|
;;
|
||||||
debian)
|
debian)
|
||||||
debian="true"
|
debian="true"
|
||||||
distro="debian"
|
distro="debian"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
silentexec $_sudo apt-get update
|
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora)
|
||||||
fedora="true"
|
fedora="true"
|
||||||
distro="fedora"
|
distro="fedora"
|
||||||
_install() { $_sudo dnf install -y "$@"; }
|
_install() { $_sudo dnf install -y "$@"; }
|
||||||
silentexec $_sudo dnf update
|
|
||||||
;;
|
;;
|
||||||
alpine)
|
alpine)
|
||||||
alpine="true"
|
alpine="true"
|
||||||
distro="alpine"
|
distro="alpine"
|
||||||
_install() { $_sudo apk add "$@"; }
|
_install() { $_sudo apk add "$@"; }
|
||||||
silentexec $_sudo apk update
|
|
||||||
;;
|
;;
|
||||||
arch | manjaro | garuda | endeavour)
|
arch | manjaro | garuda | endeavour)
|
||||||
arch="true"
|
arch="true"
|
||||||
|
@ -110,34 +106,28 @@ get_packager() {
|
||||||
opensuse="true"
|
opensuse="true"
|
||||||
distro="opensuse"
|
distro="opensuse"
|
||||||
_install() { $_sudo zypper in "$@"; }
|
_install() { $_sudo zypper in "$@"; }
|
||||||
silentexec $_sudo zypper ref
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ "${ID_LIKE#*debian}" != "$ID_LIKE" ]; then
|
if [ "${ID_LIKE#*debian}" != "$ID_LIKE" ]; then
|
||||||
debian="true"
|
debian="true"
|
||||||
distro="debian"
|
distro="debian"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
silentexec $_sudo apt-get update
|
|
||||||
elif [ "${ID_LIKE#*ubuntu}" != "$ID_LIKE" ]; then
|
elif [ "${ID_LIKE#*ubuntu}" != "$ID_LIKE" ]; then
|
||||||
ubuntu="true"
|
ubuntu="true"
|
||||||
distro="ubuntu"
|
distro="ubuntu"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
silentexec $_sudo apt-get update
|
|
||||||
elif [ "${ID_LIKE#*arch}" != "$ID_LIKE" ]; then
|
elif [ "${ID_LIKE#*arch}" != "$ID_LIKE" ]; then
|
||||||
arch="true"
|
arch="true"
|
||||||
distro="arch"
|
distro="arch"
|
||||||
_install() { $_sudo pacman -S --noconfirm "$@"; }
|
_install() { $_sudo pacman -S --noconfirm "$@"; }
|
||||||
silentexec $_sudo pacman -Sy
|
|
||||||
elif [ "${ID_LIKE#*fedora}" != "$ID_LIKE" ]; then
|
elif [ "${ID_LIKE#*fedora}" != "$ID_LIKE" ]; then
|
||||||
fedora="true"
|
fedora="true"
|
||||||
distro="fedora"
|
distro="fedora"
|
||||||
_install() { $_sudo dnf install -y "$@"; }
|
_install() { $_sudo dnf install -y "$@"; }
|
||||||
silentexec $_sudo dnf update
|
|
||||||
elif [ "${ID_LIKE#*suse}" != "$ID_LIKE" ]; then
|
elif [ "${ID_LIKE#*suse}" != "$ID_LIKE" ]; then
|
||||||
opensuse="true"
|
opensuse="true"
|
||||||
distro="opensuse"
|
distro="opensuse"
|
||||||
_install() { $_sudo zypper in "$@"; }
|
_install() { $_sudo zypper in "$@"; }
|
||||||
silentexec $_sudo zypper ref
|
|
||||||
else
|
else
|
||||||
echo_error "Unsupported distribution: $ID"
|
echo_error "Unsupported distribution: $ID"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -152,8 +142,8 @@ get_packager() {
|
||||||
|
|
||||||
update_package_list() {
|
update_package_list() {
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
ubuntu | debian) $_sudo apt-get update ;;
|
ubuntu | debian) silentexec $_sudo apt-get update ;;
|
||||||
fedora) $_sudo dnf update ;;
|
fedora) silentexec $_sudo dnf update ;;
|
||||||
arch)
|
arch)
|
||||||
if command_exists paru; then
|
if command_exists paru; then
|
||||||
silentexec paru -Sy
|
silentexec paru -Sy
|
||||||
|
@ -163,8 +153,8 @@ update_package_list() {
|
||||||
silentexec $_sudo pacman -Sy
|
silentexec $_sudo pacman -Sy
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
opensuse) $_sudo zypper ref ;;
|
opensuse) silentexec $_sudo zypper ref ;;
|
||||||
alpine) $_sudo apk update ;;
|
alpine) silentexec $_sudo apk update ;;
|
||||||
*) echo_error "Unsupported distribution: $distro" ;;
|
*) echo_error "Unsupported distribution: $distro" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue