testing the new detection for refreshing repos

This commit is contained in:
pika 2025-05-19 08:37:18 +02:00
parent 2b6ff30ed5
commit 192865ffbe

View file

@ -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