Parse actual repo name

This commit is contained in:
Ryan Hughes
2025-08-25 05:53:28 +02:00
parent b2beeaebe8
commit 2ad6cd90bb
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ FROM archlinux:latest
# Update system and install build tools
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm base-devel git sudo wget
pacman -S --noconfirm base-devel git sudo wget jq
# Create build user
RUN useradd -m -G wheel builder && \
+11 -1
View File
@@ -45,7 +45,17 @@ build_aur_package() {
# Case 3: Directory doesn't exist - clone
else
git clone "https://aur.archlinux.org/${pkg}.git" || {
# Get the package base from AUR RPC (some packages have different repo names)
local pkg_base=$(curl -s "https://aur.archlinux.org/rpc/?v=5&type=info&arg[]=$pkg" | jq -r '.results[0].PackageBase // empty')
# Fall back to package name if API call fails or returns nothing
if [[ -z "$pkg_base" ]]; then
pkg_base="$pkg"
elif [[ "$pkg_base" != "$pkg" ]]; then
echo " Using package base: $pkg_base"
fi
git clone "https://aur.archlinux.org/${pkg_base}.git" "$pkg" || {
echo " Failed to clone $pkg"
FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
return 1