Parse actual repo name
This commit is contained in:
1 parent
b2beeaebe8
commit
2ad6cd90bb
2 files changed
+12
-2
No files matched your search
+1
-1
@@ -2,7 +2,7 @@ FROM archlinux:latest
|
|||||||
|
|
||||||
# Update system and install build tools
|
# Update system and install build tools
|
||||||
RUN pacman -Syu --noconfirm && \
|
RUN pacman -Syu --noconfirm && \
|
||||||
pacman -S --noconfirm base-devel git sudo wget
|
pacman -S --noconfirm base-devel git sudo wget jq
|
||||||
|
|
||||||
# Create build user
|
# Create build user
|
||||||
RUN useradd -m -G wheel builder && \
|
RUN useradd -m -G wheel builder && \
|
||||||
|
|||||||
+11
-1
@@ -45,7 +45,17 @@ build_aur_package() {
|
|||||||
|
|
||||||
# Case 3: Directory doesn't exist - clone
|
# Case 3: Directory doesn't exist - clone
|
||||||
else
|
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"
|
echo " Failed to clone $pkg"
|
||||||
FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
|
FAILED_PACKAGES="$FAILED_PACKAGES $pkg"
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
Reference in new issue
Block a user