Skip to content

Commit a561c1d

Browse files
committed
repro: Support fetching correct makepkg.conf from devtools
Signed-off-by: Morten Linderud <morten@linderud.pw>
1 parent 2c88d88 commit a561c1d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

repro.in

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ CONFIGDIR='REPRO_CONFIG_DIR'
1818

1919
HOSTMIRROR="https://europe.mirror.pkgbuild.com/\$repo/os/\$arch"
2020

21+
ARCHIVEURL="${ARCH_ARCHIVE_CACHE:-https://archive.archlinux.org/packages}"
22+
2123
IMGDIRECTORY=$(mktemp -dt XXXXXXXXXX.arch_img)
2224
trap "{ rm -r $IMGDIRECTORY; }" EXIT
2325

@@ -336,12 +338,22 @@ function cmd_check(){
336338
format=${buildinfo[format]}
337339
installed=${buildinfo[installed]}
338340

339-
340341
pkgbuild_sha256sum="${buildinfo[pkgbuild_sha256sum]}"
341342
SOURCE_DATE_EPOCH="${buildinfo[builddate]}"
342343
BUILDTOOL=${buildinfo[buildtool]}
343344
BUILDTOOLVER=${buildinfo[buildtoolver]}
344345

346+
DEVTOOLS="current devtools (fallback)"
347+
DEVTOOLS_PKG="devtools"
348+
if [[ -z "${BUILDTOOL}" ]] || [[ "${BUILDTOOL}" = makepkg ]]; then
349+
DEVTOOLS="devtools-20210202-3-any"
350+
DEVTOOLS_PKG="$ARCHIVEURL/${BUILDTOOL:0:1}/${DEVTOOLS}.pkg.tar${pkg##*tar}"
351+
elif [[ "${BUILDTOOL}" = devtools ]] ; then
352+
DEVTOOLS="${BUILDTOOL}-${BUILDTOOLVER}"
353+
DEVTOOLS_PKG="$ARCHIVEURL/${BUILDTOOL:0:1}/${DEVTOOLS}.pkg.tar${pkg##*tar}"
354+
fi
355+
msg2 "Using devtools version: %s" "${DEVTOOLS}"
356+
345357
if [[ ${format} -ne 1 && ${format} -ne 2 ]]; then
346358
error "unsupported BUILDINFO format or no format definition found, aborting rebuild"
347359
exit 1
@@ -473,7 +485,11 @@ pacstrap -G -U /mnt --needed "\$@"
473485
# Ignore all dependencies since we only want the file
474486
# Saves us a few seconds and doesn't download a bunch of things
475487
# we are getting rid off
476-
pacman --noconfirm --needed -Sddu devtools
488+
if [[ "$DEVTOOLS_PKG" == https* ]]; then
489+
pacman --noconfirm --needed -Udd "$DEVTOOLS_PKG"
490+
else
491+
pacman --noconfirm --needed -Sddu "$DEVTOOLS_PKG"
492+
fi
477493
cp -v /usr/share/devtools/makepkg-x86_64.conf /mnt/etc/makepkg.conf
478494
__END__
479495
lock_close 9 "$KEYRINGCACHE/$keyring_package.lock"

0 commit comments

Comments
 (0)