diff --git a/install.sh b/install.sh index 28c80c3..cd54605 100755 --- a/install.sh +++ b/install.sh @@ -129,8 +129,11 @@ elif command -v pacman &> /dev/null; then print_info "Installing basic prerequisites: ${MISSING_PACKAGES[*]}" # Use sudo only if not running as root if [ "$EUID" -eq 0 ]; then + # Sync package database first (required in fresh containers) + pacman -Sy --noconfirm pacman -S --noconfirm ${MISSING_PACKAGES[*]} else + sudo pacman -Sy --noconfirm sudo pacman -S --noconfirm ${MISSING_PACKAGES[*]} fi print_success "Basic prerequisites installed" @@ -226,8 +229,11 @@ elif command -v pacman &> /dev/null; then echo "Installing: python-pip python-gobject python-dbus python-cairo bluez bluez-utils" # Use sudo only if not running as root if [ "$EUID" -eq 0 ]; then + # Sync package database first (may have been synced in basic prereqs, but ensure it's current) + pacman -Sy --noconfirm pacman -S --noconfirm python-pip python-gobject python-dbus python-cairo bluez bluez-utils else + sudo pacman -Sy --noconfirm sudo pacman -S --noconfirm python-pip python-gobject python-dbus python-cairo bluez bluez-utils fi print_success "System dependencies installed (using pre-compiled system packages)" diff --git a/tests/test_installer.sh b/tests/test_installer.sh index 8b01e4d..dd6378b 100755 --- a/tests/test_installer.sh +++ b/tests/test_installer.sh @@ -37,7 +37,8 @@ echo "" check_package() { local pkg="$1" if [ "$OS_TYPE" = "debian" ]; then - dpkg -l | grep -q "^ii $pkg " || { echo "FAIL: $pkg not installed"; exit 1; } + # Match package with or without architecture suffix (e.g., python3-cairo:amd64) + dpkg -l | grep -q "^ii $pkg" || { echo "FAIL: $pkg not installed"; exit 1; } elif [ "$OS_TYPE" = "arch" ]; then pacman -Q "$pkg" &> /dev/null || { echo "FAIL: $pkg not installed"; exit 1; } fi