basic and utils: overhaul set-up

This commit is contained in:
2026-09-05 21:30:54 +02:00
parent aaecbd8472
commit 84db84b542
9 changed files with 324 additions and 124 deletions
+2 -41
View File
@@ -4,38 +4,6 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PACKAGES_FILE="$SCRIPT_DIR/packages.txt"
# ---------------------------------------------------------------------------
# Enable multilib in /etc/pacman.conf (with a safety backup)
# ---------------------------------------------------------------------------
enable_multilib() {
sudo sed -i.bak '/^#\[multilib\]/,+1 s/^#//' /etc/pacman.conf
}
# ---------------------------------------------------------------------------
# Ensure yay (AUR helper) is installed.
# ---------------------------------------------------------------------------
install_yay() {
if pacman -Q yay &>/dev/null; then
echo "yay bereits installiert; fahre fort."
return
fi
if pacman -Si yay &>/dev/null; then
echo "Installiere yay mit pacman ..."
sudo pacman -S --needed yay
return
fi
echo "installiere yay via git ..."
sudo pacman -S --needed base-devel git
local tmp
tmp="$(mktemp -d)"
git clone https://aur.archlinux.org/yay.git "$tmp/yay"
(
cd "$tmp/yay"
makepkg -si
)
rm -rf "$tmp"
}
# ---------------------------------------------------------------------------
# Read packages.txt, split into pacman / aur / npm sections.
# ---------------------------------------------------------------------------
@@ -125,15 +93,8 @@ add_yazi_git_plugin() {
# Main
# ---------------------------------------------------------------------------
main() {
echo "==> Aktiviere multilib ..."
enable_multilib
echo "==> System aktualisieren ..."
sudo pacman -Syu
echo "==> Sicherstelle yay ..."
install_yay
# Hinweis: multilib, yay und das System-Update werden von
# basic/setup.sh uebernommen (laeuft vor term im Makefile).
echo "==> Lese Paketliste: $PACKAGES_FILE"
read_packages