wip
This commit is contained in:
parent
0055f21f0a
commit
d8afacabf9
1 changed files with 26 additions and 10 deletions
36
distros.sh
36
distros.sh
|
@ -35,7 +35,6 @@ command_exists() {
|
|||
command -v "$@" >/dev/null 2>&1
|
||||
}
|
||||
silentexec() {
|
||||
echo_note "Refreshing repositories.."
|
||||
"$@" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
@ -66,17 +65,17 @@ get_packager() {
|
|||
ID_LIKE=$(printf "%s" "$ID_LIKE" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
case "$ID" in
|
||||
ubuntu | pop)
|
||||
ubuntu | pop | zorin | kubuntu | linuxmintubuntu)
|
||||
ubuntu="true"
|
||||
distro="ubuntu"
|
||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||
;;
|
||||
debian)
|
||||
debian | kali | linuxmint | elementary | neon | kdeneon | deepin)
|
||||
debian="true"
|
||||
distro="debian"
|
||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||
;;
|
||||
fedora)
|
||||
fedora | centos | rhel | rocky | almalinux)
|
||||
fedora="true"
|
||||
distro="fedora"
|
||||
_install() { $_sudo dnf install -y "$@"; }
|
||||
|
@ -152,25 +151,41 @@ get_packager() {
|
|||
|
||||
case "$pkger" in
|
||||
apt-get)
|
||||
debian="true"
|
||||
ubuntu="true"
|
||||
debian="true"
|
||||
distro="debian"
|
||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||
;;
|
||||
dnf)
|
||||
fedora="true"
|
||||
distro="fedora"
|
||||
_install() { $_sudo dnf install -y "$@"; }
|
||||
;;
|
||||
apk)
|
||||
alpine="true"
|
||||
distro="alpine"
|
||||
_install() { $_sudo apk add "$@"; }
|
||||
;;
|
||||
pacman)
|
||||
arch="true"
|
||||
distro="arch"
|
||||
_install() {
|
||||
if command_exists paru; then
|
||||
echo_info "Using paru"
|
||||
paru -S --color always --noconfirm --needed "$@"
|
||||
elif command_exists yay; then
|
||||
echo_info "Using yay"
|
||||
yay -S --color always --noconfirm --needed "$@"
|
||||
else
|
||||
echo_warning "Using pacman"
|
||||
$_sudo pacman -S --color always --noconfirm --needed "$@"
|
||||
fi
|
||||
}
|
||||
;;
|
||||
alpine)
|
||||
alpine="true"
|
||||
distro="alpine"
|
||||
;;
|
||||
opensuse*)
|
||||
zypper)
|
||||
opensuse="true"
|
||||
distro="opensuse"
|
||||
_install() { $_sudo zypper in "$@"; }
|
||||
;;
|
||||
*)
|
||||
echo_error "Can not detect distribution correctly!"
|
||||
|
@ -182,6 +197,7 @@ get_packager() {
|
|||
}
|
||||
|
||||
update_package_list() {
|
||||
echo_note "Refreshing repositories.."
|
||||
case "$distro" in
|
||||
ubuntu | debian) silentexec $_sudo apt-get update ;;
|
||||
fedora) silentexec $_sudo dnf update ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue