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
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
silentexec() {
|
silentexec() {
|
||||||
echo_note "Refreshing repositories.."
|
|
||||||
"$@" >/dev/null 2>&1
|
"$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,17 +65,17 @@ get_packager() {
|
||||||
ID_LIKE=$(printf "%s" "$ID_LIKE" | tr '[:upper:]' '[:lower:]')
|
ID_LIKE=$(printf "%s" "$ID_LIKE" | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
case "$ID" in
|
case "$ID" in
|
||||||
ubuntu | pop)
|
ubuntu | pop | zorin | kubuntu | linuxmintubuntu)
|
||||||
ubuntu="true"
|
ubuntu="true"
|
||||||
distro="ubuntu"
|
distro="ubuntu"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
;;
|
;;
|
||||||
debian)
|
debian | kali | linuxmint | elementary | neon | kdeneon | deepin)
|
||||||
debian="true"
|
debian="true"
|
||||||
distro="debian"
|
distro="debian"
|
||||||
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
;;
|
;;
|
||||||
fedora)
|
fedora | centos | rhel | rocky | almalinux)
|
||||||
fedora="true"
|
fedora="true"
|
||||||
distro="fedora"
|
distro="fedora"
|
||||||
_install() { $_sudo dnf install -y "$@"; }
|
_install() { $_sudo dnf install -y "$@"; }
|
||||||
|
@ -152,25 +151,41 @@ get_packager() {
|
||||||
|
|
||||||
case "$pkger" in
|
case "$pkger" in
|
||||||
apt-get)
|
apt-get)
|
||||||
debian="true"
|
|
||||||
ubuntu="true"
|
ubuntu="true"
|
||||||
|
debian="true"
|
||||||
distro="debian"
|
distro="debian"
|
||||||
|
_install() { $_sudo apt-get install --assume-yes "$@"; }
|
||||||
;;
|
;;
|
||||||
dnf)
|
dnf)
|
||||||
fedora="true"
|
fedora="true"
|
||||||
distro="fedora"
|
distro="fedora"
|
||||||
|
_install() { $_sudo dnf install -y "$@"; }
|
||||||
|
;;
|
||||||
|
apk)
|
||||||
|
alpine="true"
|
||||||
|
distro="alpine"
|
||||||
|
_install() { $_sudo apk add "$@"; }
|
||||||
;;
|
;;
|
||||||
pacman)
|
pacman)
|
||||||
arch="true"
|
arch="true"
|
||||||
distro="arch"
|
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)
|
zypper)
|
||||||
alpine="true"
|
|
||||||
distro="alpine"
|
|
||||||
;;
|
|
||||||
opensuse*)
|
|
||||||
opensuse="true"
|
opensuse="true"
|
||||||
distro="opensuse"
|
distro="opensuse"
|
||||||
|
_install() { $_sudo zypper in "$@"; }
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo_error "Can not detect distribution correctly!"
|
echo_error "Can not detect distribution correctly!"
|
||||||
|
@ -182,6 +197,7 @@ get_packager() {
|
||||||
}
|
}
|
||||||
|
|
||||||
update_package_list() {
|
update_package_list() {
|
||||||
|
echo_note "Refreshing repositories.."
|
||||||
case "$distro" in
|
case "$distro" in
|
||||||
ubuntu | debian) silentexec $_sudo apt-get update ;;
|
ubuntu | debian) silentexec $_sudo apt-get update ;;
|
||||||
fedora) silentexec $_sudo dnf update ;;
|
fedora) silentexec $_sudo dnf update ;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue