Simplify and solve cache issue
This commit is contained in:
2 files changed
+6
-34
No files matched your search
@@ -103,11 +103,6 @@ DOCKER_ARGS=(
|
|||||||
-v "$BUILD_ROOT/pkgbuilds:/pkgbuilds:ro"
|
-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
|
# Run the builder with assembled args
|
||||||
IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH"
|
IMAGE_TAG="omarchy-pkg-builder:latest-$ARCH"
|
||||||
PLATFORM_ARG=$(get_platform_arg "$ARCH")
|
PLATFORM_ARG=$(get_platform_arg "$ARCH")
|
||||||
|
|||||||
+6
-29
@@ -16,13 +16,8 @@ echo "==> Configuring Omarchy repositories for dependency resolution..."
|
|||||||
|
|
||||||
# Always add omarchy-build repo (for incremental builds)
|
# Always add omarchy-build repo (for incremental builds)
|
||||||
# Packages in build-output are unsigned, so use SigLevel = Never
|
# 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 <<EOF
|
sudo tee -a /etc/pacman.conf > /dev/null <<EOF
|
||||||
|
|
||||||
[options]
|
|
||||||
CacheDir = /var/cache/pacman/pkg
|
|
||||||
CacheDir = $BUILD_OUTPUT_DIR
|
|
||||||
|
|
||||||
[omarchy-build]
|
[omarchy-build]
|
||||||
SigLevel = Never
|
SigLevel = Never
|
||||||
Server = file://$BUILD_OUTPUT_DIR
|
Server = file://$BUILD_OUTPUT_DIR
|
||||||
@@ -123,37 +118,19 @@ build_package() {
|
|||||||
MAKEPKG_FLAGS="-scf --noconfirm"
|
MAKEPKG_FLAGS="-scf --noconfirm"
|
||||||
|
|
||||||
if makepkg $MAKEPKG_FLAGS; then
|
if makepkg $MAKEPKG_FLAGS; then
|
||||||
# Copy to build workspace
|
|
||||||
for pkg_file in *.pkg.tar.*; do
|
for pkg_file in *.pkg.tar.*; do
|
||||||
if [[ -f "$pkg_file" ]]; then
|
[[ -f "$pkg_file" ]] && cp "$pkg_file" "$BUILD_OUTPUT_DIR/"
|
||||||
cp "$pkg_file" "$BUILD_OUTPUT_DIR/"
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Update the build database so it's available via pacman
|
|
||||||
echo " Updating omarchy-build database..."
|
|
||||||
cd "$BUILD_OUTPUT_DIR"
|
cd "$BUILD_OUTPUT_DIR"
|
||||||
|
|
||||||
# Find the package file we just built (not .sig)
|
# Find ALL package files (handles split packages)
|
||||||
local new_pkg=$(ls -t ${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | head -1)
|
local new_pkgs=($(ls -t ${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | grep -v 'omarchy-build\.db'))
|
||||||
|
|
||||||
if [[ -n "$new_pkg" ]]; then
|
if [[ ${#new_pkgs[@]} -gt 0 ]]; then
|
||||||
echo " Adding $new_pkg to database..."
|
repo-add omarchy-build.db.tar.zst "${new_pkgs[@]}" >/dev/null 2>&1
|
||||||
|
|
||||||
# Add to omarchy-build database
|
|
||||||
repo-add omarchy-build.db.tar.zst "$new_pkg" 2>&1 | grep -E "==>|error" || true
|
|
||||||
ln -sf omarchy-build.db.tar.zst omarchy-build.db
|
ln -sf omarchy-build.db.tar.zst omarchy-build.db
|
||||||
|
sudo pacman -Sy >/dev/null 2>&1
|
||||||
# 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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd /src/$pkg
|
cd /src/$pkg
|
||||||
|
|||||||
Reference in new issue
Block a user