Always add to build db as we go
This commit is contained in:
1 file changed
+20
-26
+20
-26
@@ -130,40 +130,34 @@ build_package() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# If this package is a dependency of another package being built,
|
# Update the build database so it's available via pacman
|
||||||
# update the build database so it's available via pacman
|
echo " Updating omarchy-build database..."
|
||||||
if [[ "${INSTALL_PACKAGES[$pkg]}" == "1" ]]; then
|
cd "$BUILD_OUTPUT_DIR"
|
||||||
echo " Updating omarchy-build database (needed as dependency)..."
|
|
||||||
cd "$BUILD_OUTPUT_DIR"
|
|
||||||
|
|
||||||
# Find the package file we just built (not .sig)
|
# Find the package file we just built (not .sig)
|
||||||
local new_pkg=$(ls -t ${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | head -1)
|
local new_pkg=$(ls -t ${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | head -1)
|
||||||
|
|
||||||
if [[ -n "$new_pkg" ]]; then
|
if [[ -n "$new_pkg" ]]; then
|
||||||
echo " Adding $new_pkg to database..."
|
echo " Adding $new_pkg to database..."
|
||||||
|
|
||||||
# Add to omarchy-build database
|
# Add to omarchy-build database
|
||||||
repo-add omarchy-build.db.tar.zst "$new_pkg" 2>&1 | grep -E "==>|error" || true
|
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
|
||||||
|
|
||||||
# Sync filesystem to ensure package file is fully written
|
# Refresh pacman databases so it sees the new package
|
||||||
sync
|
echo " Refreshing pacman database..."
|
||||||
|
sudo pacman -Sy 2>&1 | grep -E "omarchy-build|error" || true
|
||||||
|
|
||||||
# Refresh pacman databases so it sees the new package
|
# Verify the package is in the database
|
||||||
echo " Refreshing pacman database..."
|
if pacman -Sl omarchy-build 2>/dev/null | grep -q "^omarchy-build $pkg "; then
|
||||||
sudo pacman -Sy 2>&1 | grep -E "omarchy-build|error" || true
|
echo " ✓ Package available in omarchy-build repo"
|
||||||
|
else
|
||||||
# Verify the package is in the database
|
echo " ⚠ Warning: Package not found in omarchy-build repo"
|
||||||
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
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cd /src/$pkg
|
||||||
|
|
||||||
echo " ✓ Successfully built $pkg"
|
echo " ✓ Successfully built $pkg"
|
||||||
SUCCESSFUL_PACKAGES="$SUCCESSFUL_PACKAGES $pkg"
|
SUCCESSFUL_PACKAGES="$SUCCESSFUL_PACKAGES $pkg"
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in new issue
Block a user