added some text to the readme

This commit is contained in:
2025-05-21 03:39:28 +02:00
parent 30e2c0c4d3
commit 248e489822
3 changed files with 1 additions and 6 deletions

View File

@@ -1,2 +1,3 @@
# ALHP_PACMAN_HOOKS
In scripts you find a bash script to check the alhp api for building packages, a wrapper script for the use with the hooks and in hooks you find a hook for installing new packages that checks if the package is building right now and one for upgrades.

View File

@@ -6,7 +6,6 @@ updatesAvailable() {
output_json=false
check_pkg=""
# Parse arguments
while [[ $# -gt 0 ]]; do
case "$1" in
-j|--json) output_json=true; shift ;;
@@ -23,7 +22,6 @@ updatesAvailable() {
declare -A pkgs
# Collect installed packages
yay -Sl "${repos[@]}" | while read -r _ name version status; do
if [[ $status == *installed* ]]; then
pkgs["$name"]=1
@@ -34,7 +32,6 @@ updatesAvailable() {
api_url="https://api.alhp.dev/packages?limit=0&offset=0&status=queued&status=building${repo_query}"
if [[ -n "$check_pkg" ]]; then
# Check if a specific package is building
building_pkgs=$(curl -s "$api_url" \
| jq -r --arg pkg "$check_pkg" '.packages[] | select(.split_packages[] == $pkg) | .split_packages[]')
@@ -52,7 +49,6 @@ updatesAvailable() {
fi
else
# Full scan
matches=()
while read -r pkgname; do
if [[ -n "${pkgs[$pkgname]}" ]]; then

View File

@@ -4,7 +4,6 @@ ALHP_SCRIPT="/usr/local/bin/alhp-check.sh"
building_pkgs=()
if [[ $# -gt 0 ]]; then
# Check only specified packages (for install hook)
for pkg in "$@"; do
result=$($ALHP_SCRIPT --check-pkg "$pkg" -j)
if [[ "$result" != "[]" ]]; then
@@ -12,7 +11,6 @@ if [[ $# -gt 0 ]]; then
fi
done
else
# No args: full scan (for upgrade hook)
mapfile -t building_pkgs < <($ALHP_SCRIPT)
fi