From dacf0cd9a4f97b4343bfb1644dce5783286728de Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Thu, 30 Oct 2025 00:36:19 -0400 Subject: [PATCH] Simplify and solve cache issue --- bin/build | 5 ----- build/build.sh | 35 ++++++----------------------------- 2 files changed, 6 insertions(+), 34 deletions(-) diff --git a/bin/build b/bin/build index de93333..e8013d1 100755 --- a/bin/build +++ b/bin/build @@ -103,11 +103,6 @@ DOCKER_ARGS=( -v "$BUILD_ROOT/pkgbuilds:/pkgbuilds:ro" ) -# Use local pacman cache if you already have one on host to speed up repeat runs -if [ -d "/var/cache/pacman/pkg" ]; then - DOCKER_ARGS+=(-v "/var/cache/pacman/pkg:/var/cache/pacman/pkg") -fi - # Run the builder with assembled args IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH" PLATFORM_ARG=$(get_platform_arg "$ARCH") diff --git a/build/build.sh b/build/build.sh index 2dfa90c..6ab250f 100755 --- a/build/build.sh +++ b/build/build.sh @@ -16,13 +16,8 @@ echo "==> Configuring Omarchy repositories for dependency resolution..." # Always add omarchy-build repo (for incremental builds) # Packages in build-output are unsigned, so use SigLevel = Never -# Use the build-output dir as additional cache to avoid file copying issues sudo tee -a /etc/pacman.conf > /dev/null </dev/null | grep -v '\.sig$' | head -1) + # Find ALL package files (handles split packages) + local new_pkgs=($(ls -t ${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | grep -v 'omarchy-build\.db')) - if [[ -n "$new_pkg" ]]; then - echo " Adding $new_pkg to database..." - - # Add to omarchy-build database - repo-add omarchy-build.db.tar.zst "$new_pkg" 2>&1 | grep -E "==>|error" || true + if [[ ${#new_pkgs[@]} -gt 0 ]]; then + repo-add omarchy-build.db.tar.zst "${new_pkgs[@]}" >/dev/null 2>&1 ln -sf omarchy-build.db.tar.zst omarchy-build.db - - # Refresh pacman databases so it sees the new package - echo " Refreshing pacman database..." - sudo pacman -Sy 2>&1 | grep -E "omarchy-build|error" || true - - # Verify the package is in the database - if pacman -Sl omarchy-build 2>/dev/null | grep -q "^omarchy-build $pkg "; then - echo " ✓ Package available in omarchy-build repo" - else - echo " ⚠ Warning: Package not found in omarchy-build repo" - fi + sudo pacman -Sy >/dev/null 2>&1 fi cd /src/$pkg