Parse actual repo name
This commit is contained in:
+1
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user