Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with the full system update #420

Open
luvth opened this issue Feb 23, 2025 · 4 comments
Open

Issue with the full system update #420

luvth opened this issue Feb 23, 2025 · 4 comments

Comments

@luvth
Copy link

luvth commented Feb 23, 2025

When the script execute the full system update and install dependencies like bspwm, sometimes it can fail, but the script will continue

That broke my system, broke zsh, be careful about that issue, i will do à pull requests soon to fix it. Dont worry

@arnav4o4
Copy link

I found a way how to fix this!!!!

You have to manually install ueberzugpp and remove uberzug

@gh0stzk
Copy link
Owner

gh0stzk commented Feb 23, 2025

Im already test it the ueberzugpp problem, yes apparently the --noconfirm flag does not do anything if you need to replace a package, in this case uberzug for ueberzugpp..

Let me think a solution.. sorry for that.

@luvth
Copy link
Author

luvth commented Feb 23, 2025

install_dependencies() {
clear
logo "Installing needed packages.."
sleep 2

# Internal verification function
is_installed() {
    pacman -Qq "$1" >/dev/null 2>&1
}

# List of dependencies
local dependencies=(
    alacritty base-devel bat brightnessctl bspwm clipcat dunst eza feh
    gvfs-mtp firefox geany git imagemagick jq jgmenu kitty libwebp maim
    mpc mpd mpv neovim ncmpcpp npm pamixer pacman-contrib papirus-icon-theme
    picom playerctl polybar polkit-gnome python-gobject redshift rofi rustup
    sxhkd tmux xclip xdg-user-dirs xdo xdotool xsettingsd xorg-xdpyinfo
    xorg-xkill xorg-xprop xorg-xrandr xorg-xsetroot xorg-xwininfo yazi zsh
    zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting
    ttf-inconsolata ttf-jetbrains-mono ttf-jetbrains-mono-nerd ttf-terminus-nerd
    ttf-ubuntu-mono-nerd ueberzugpp webp-pixbuf-loader paru tdrop eww-git
    i3lock-color simple-mtpfs gh0stzk-gtk-themes gh0stzk-cursor-qogirr
    gh0stzk-icons-beautyline gh0stzk-icons-candy gh0stzk-icons-catppuccin-mocha
    gh0stzk-icons-dracula gh0stzk-icons-glassy gh0stzk-icons-gruvbox-plus-dark
    gh0stzk-icons-hack gh0stzk-icons-luv gh0stzk-icons-sweet-rainbow
    gh0stzk-icons-tokyo-night gh0stzk-icons-vimix-white gh0stzk-icons-zafiro gh0stzk-icons-zafiro-purple
)

echo -e "${BLD}${CBL}Checking for required packages...${CNC}\n"
sleep 2

# Detect missing packages
local missing_pkgs=()
for pkg in "${dependencies[@]}"; do
    if ! is_installed "$pkg"; then
        missing_pkgs+=("$pkg")
        echo -e " ${BLD}${CYE}${pkg} ${CRE}not installed${CNC}"
    else
        echo -e "${BLD}${CGR}${pkg} ${CBL}already installed${CNC}"
    fi
done

# Batch installation
if ((${#missing_pkgs[@]} > 0)); then
    echo -e "\n${BLD}${CYE}Installing ${#missing_pkgs[@]} packages...${CNC}\n"

    # Try to install packages
    if ! sudo pacman -S --noconfirm --needed "${missing_pkgs[@]}" >> "$ERROR_LOG" 2>&1; then
        log_error "Critical error during package installation"
        echo -e "\n${BLD}${CRE}ERROR: Failed to install required packages!${CNC}"
        echo -e "${BLD}${CRE}Please check ${CYE}$ERROR_LOG${CRE} for more details${CNC}"
        echo -e "${BLD}${CRE}The installation process cannot continue without these packages.${CNC}\n"
        exit 1
    fi

    # Verify all packages were installed correctly
    local failed_pkgs=()
    for pkg in "${missing_pkgs[@]}"; do
        if ! is_installed "$pkg"; then
            failed_pkgs+=("$pkg")
        fi
    done

    # If any package failed to install, exit with error
    if ((${#failed_pkgs[@]} > 0)); then
        echo -e "\n${BLD}${CRE}ERROR: Failed to install the following packages:${CNC}"
        for pkg in "${failed_pkgs[@]}"; do
            echo -e "  ${BLD}${CYE}• ${pkg}${CNC}"
        done
        echo -e "\n${BLD}${CRE}The installation process cannot continue.${CNC}"
        echo -e "${BLD}${CRE}Please check ${CYE}$ERROR_LOG${CRE} for more details${CNC}\n"
        exit 1
    fi

    echo -e "${BLD}${CGR}All packages installed successfully!${CNC}\n"
else
    echo -e "\n${BLD}${CGR}All dependencies are already installed!${CNC}"
fi

sleep 3
return 0

}

Maybe this will work ?

@gh0stzk
Copy link
Owner

gh0stzk commented Feb 23, 2025

Since ueberzug seems to me to be the only package that would need a replacement, perhaps instead of completely exiting the script, it would be easy to manage the package individually if it existed previously, I think this would help.

I just finished testing locally and it works without errors.

Put this right below the dependencies array list.

# Handle ueberzug/ueberzugpp conflict
    if is_installed "ueberzug"; then
        echo -e "${BLD}${CYE}Removing conflicting ueberzug package...${CNC}"
        sudo pacman -Rns --noconfirm ueberzug >> "$ERROR_LOG" 2>&1 || {
            log_error "Failed to remove ueberzug"
            echo -e "${BLD}${CRE}Error removing ueberzug! Check logs${CNC}"
        }
    fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants