From 3ad8ffffcf996605f79f3bfb54347f1290235702 Mon Sep 17 00:00:00 2001 From: torlando-tech Date: Tue, 28 Oct 2025 21:07:08 -0400 Subject: [PATCH] fix: Arch Linux package database sync and dpkg pattern matching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix two issues preventing installer tests from passing: 1. Arch Linux: Sync package database before installing packages - Fresh Arch containers have no package database (core, extra) - Added pacman -Sy before pacman -S in both basic prereqs and system deps - Error was: "warning: database file for 'core' does not exist" - Applied to both root and non-root installation paths 2. Debian/Ubuntu: Fix package check pattern for architecture suffixes - dpkg shows packages as "python3-cairo:amd64" not "python3-cairo " - Changed grep pattern from "^ii $pkg " to "^ii $pkg" - Now matches packages with or without :amd64/:arm64 suffixes - Error was: "FAIL: python3-cairo not installed" (even though it was) Changes: - install.sh lines 132-134, 233-234: Add pacman -Sy sync before install - tests/test_installer.sh line 41: Fix dpkg grep pattern This allows all 5 OS versions to pass: - Debian 12 (Bookworm) - Debian Trixie (testing) - Ubuntu 22.04 LTS - Ubuntu 24.04 LTS - Arch Linux (rolling) [NEW] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- install.sh | 6 ++++++ tests/test_installer.sh | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) 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