From 06a21fb8c2c6b89bf51a65799ba858dffb899363 Mon Sep 17 00:00:00 2001 From: Pepe44DEV Date: Wed, 27 May 2026 22:53:36 +0200 Subject: [PATCH] fix: paru-bin (pre-compiled) statt paru aus Source bauen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alter Code: - paru aus Source (braucht rustup + rust compiler → langsam + Fehleranfällig) - 2>/dev/null + 2>&1 | tail -5 versteckte ALLE Fehler - makepkg als root ausgeführt → schlägt fehl (makepkg verweigert root) - yay als zweiter Versuch hatte die selben Probleme Neuer Code: - paru-bin (pre-compiled binary, kein Rust nötig) - KEINE stderr-Unterdrückung mehr → Fehler sichtbar - is_root()-Check: klare Warnung + Anleitung falls als root ausgeführt - yay-bin als Fallback falls paru-bin scheitert --- lib/utils.sh | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 85f80e1..0232d48 100755 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -267,29 +267,48 @@ install_aur_helper() { return 0 fi - if ! command -v git >/dev/null 2>&1; then - sudo_run pacman -S --needed --noconfirm git base-devel + if is_root; then + tui_warn "Running as root — makepkg refuses to run as root." + tui_info "Switch to a normal user with sudo access and re-run, or install paru manually:" + tui_info " pacman -S --needed git && git clone https://aur.archlinux.org/paru-bin.git" + tui_info " cd paru-bin && makepkg -si" + return 1 fi + command -v git >/dev/null 2>&1 || sudo_run pacman -S --needed --noconfirm git + local build_dir build_dir="$(mktemp -d)" - sudo_run pacman -S --needed --noconfirm rustup 2>/dev/null || true - - if have rustup; then - rustup default stable >/dev/null 2>&1 || true + tui_info "Downloading paru-bin from AUR..." + if ! git clone https://aur.archlinux.org/paru-bin.git "$build_dir/paru-bin"; then + tui_error "Failed to download paru-bin. Check network connectivity." + rm -rf "$build_dir" + return 1 fi - if git clone https://aur.archlinux.org/paru.git "$build_dir/paru" 2>/dev/null; then - (cd "$build_dir/paru" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || { - tui_warn "paru build failed, trying yay..." - if git clone https://aur.archlinux.org/yay.git "$build_dir/yay" 2>/dev/null; then - (cd "$build_dir/yay" && makepkg -si --needed --noconfirm) 2>&1 | tail -5 || { - tui_warn "yay build failed too. Install manually: paru -S paru-bin" - } - fi - } + tui_info "Building paru-bin with makepkg..." + if (cd "$build_dir/paru-bin" && makepkg -si --needed --noconfirm); then + tui_success "paru installed successfully" + rm -rf "$build_dir" + return 0 fi + local rc=$? + tui_warn "makepkg failed (exit $rc). Trying yay-bin..." + rm -rf "$build_dir/paru-bin" + + if git clone https://aur.archlinux.org/yay-bin.git "$build_dir/yay-bin"; then + if (cd "$build_dir/yay-bin" && makepkg -si --needed --noconfirm); then + tui_success "yay installed successfully" + rm -rf "$build_dir" + return 0 + fi + fi + + tui_warn "Could not install AUR helper. Install manually:" + tui_info " cd /tmp && git clone https://aur.archlinux.org/paru-bin.git" + tui_info " cd paru-bin && makepkg -si" rm -rf "$build_dir" + return 1 }