testing the new detection for refreshing repos
This commit is contained in:
parent
2b6ff30ed5
commit
192865ffbe
1 changed files with 13 additions and 5 deletions
18
distros.sh
18
distros.sh
|
@ -10,7 +10,7 @@ fedora="false"
|
|||
alpine="false"
|
||||
opensuse="false"
|
||||
|
||||
# ─< ANSI color codes >───────────────────────────────────────────────────────────────────
|
||||
# ─< old - ANSI color codes >───────────────────────────────────────────────────────────────────
|
||||
# RED='\033[0;31m'
|
||||
# CYAN='\033[0;36m'
|
||||
# YELLOW='\033[0;33m'
|
||||
|
@ -122,7 +122,7 @@ run() {
|
|||
checkAndInstall() {
|
||||
# echo "DEBUG:: GOT ARRAY :: ${@}"
|
||||
# ─< if it's not a list, then just check and install the package.. >──────────────────────
|
||||
if [ -z "$2" ]; then
|
||||
if [[ -z $2 ]]; then
|
||||
if ! command_exists "$1"; then
|
||||
echo_pkg deps "Installing $1 .."
|
||||
run _install "$1"
|
||||
|
@ -369,7 +369,7 @@ dist_setup() {
|
|||
}
|
||||
|
||||
update_package_list() {
|
||||
echo_note "Refreshing repositories.."
|
||||
echo_info "Refreshing repository sources.."
|
||||
case "$distro" in
|
||||
ubuntu | debian) run $_sudo apt-get update ;;
|
||||
fedora) run $_sudo dnf update ;;
|
||||
|
@ -384,12 +384,20 @@ update_package_list() {
|
|||
;;
|
||||
opensuse) run $_sudo zypper ref ;;
|
||||
alpine) run $_sudo apk update ;;
|
||||
*) echo_error "Unsupported distribution: $distro" ;;
|
||||
*) echo_error "Unsupported distribution: ${BRIGHT_RED}$distro" ;;
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
if check_root; then
|
||||
get_packager
|
||||
dist_setup
|
||||
update_package_list
|
||||
|
||||
if [[ -z $PIKA_INIT ]]; then
|
||||
echo_info "First time being imported.."
|
||||
export PIKA_INIT=true
|
||||
|
||||
update_package_list
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue