Add CachyOS keyrings and AUR packages

This commit is contained in:
alvinlollo
2026-09-15 15:37:24 +10:00
committed by alvinlollo
parent 9afaf4f18a
commit 0aa143fe75
29 changed files with 98565 additions and 18 deletions
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail
# Sync local AUR repository: puts any package files you pass in into
# ./localrepo, rebuilds the repo database from every *.pkg.tar.zst there,
# and appends each package's name to packages.x86_64 so it gets installed
# into the ISO.
#
# Usage: ./localrepo/update.sh pkg1.pkg.tar.zst [pkg2.pkg.tar.zst ...]
# ./localrepo/update.sh # just re-add whatever is there
repo_name="local-aur"
profile_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
repo_dir="${profile_dir}/localrepo"
for f in "$@"; do
[[ -f "${f}" ]] || { echo "error: not a file: ${f}" >&2; exit 1; }
mv -n -- "${f}" "${repo_dir}/"
done
mapfile -t pkgs < <(find "${repo_dir}" -maxdepth 1 -name '*.pkg.tar.zst' -print | sort)
if [[ ${#pkgs[@]} -eq 0 ]]; then
echo "No .pkg.tar.zst files in ${repo_dir}" >&2
exit 0
fi
repo-add -R "${repo_dir}/${repo_name}.db.tar.gz" "${pkgs[@]}"
new_names=()
for p in "${pkgs[@]}"; do
name=$(tar -xOf "${p}" .PKGINFO | sed -n 's/^pkgname = //p' | head -1)
new_names+=("${name}")
done
pkgfile="${profile_dir}/packages.x86_64"
touch "${pkgfile}"
for name in "${new_names[@]}"; do
grep -qxF "${name}" "${pkgfile}" || echo "${name}" >> "${pkgfile}"
done
sort -u -o "${pkgfile}" "${pkgfile}"
echo "Local repo ready. packages.x86_64 now includes:"
printf ' %s\n' "${new_names[@]}"