fix: paru-bin (pre-compiled) statt paru aus Source bauen
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
This commit is contained in:
57
lib/utils.sh
57
lib/utils.sh
@@ -267,29 +267,48 @@ install_aur_helper() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
if is_root; then
|
||||||
sudo_run pacman -S --needed --noconfirm git base-devel
|
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
|
fi
|
||||||
|
|
||||||
|
command -v git >/dev/null 2>&1 || sudo_run pacman -S --needed --noconfirm git
|
||||||
|
|
||||||
local build_dir
|
local build_dir
|
||||||
build_dir="$(mktemp -d)"
|
build_dir="$(mktemp -d)"
|
||||||
|
|
||||||
sudo_run pacman -S --needed --noconfirm rustup 2>/dev/null || true
|
tui_info "Downloading paru-bin from AUR..."
|
||||||
|
if ! git clone https://aur.archlinux.org/paru-bin.git "$build_dir/paru-bin"; then
|
||||||
if have rustup; then
|
tui_error "Failed to download paru-bin. Check network connectivity."
|
||||||
rustup default stable >/dev/null 2>&1 || true
|
|
||||||
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
|
|
||||||
}
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -rf "$build_dir"
|
rm -rf "$build_dir"
|
||||||
|
return 1
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user