Skip to content

Commit

Permalink
repro: Support fetching correct makepkg.conf from devtools
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Linderud <[email protected]>
  • Loading branch information
Foxboron committed Dec 21, 2021
1 parent 2c88d88 commit a561c1d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions repro.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ CONFIGDIR='REPRO_CONFIG_DIR'

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

ARCHIVEURL="${ARCH_ARCHIVE_CACHE:-https://archive.archlinux.org/packages}"

IMGDIRECTORY=$(mktemp -dt XXXXXXXXXX.arch_img)
trap "{ rm -r $IMGDIRECTORY; }" EXIT

Expand Down Expand Up @@ -336,12 +338,22 @@ function cmd_check(){
format=${buildinfo[format]}
installed=${buildinfo[installed]}


pkgbuild_sha256sum="${buildinfo[pkgbuild_sha256sum]}"
SOURCE_DATE_EPOCH="${buildinfo[builddate]}"
BUILDTOOL=${buildinfo[buildtool]}
BUILDTOOLVER=${buildinfo[buildtoolver]}

DEVTOOLS="current devtools (fallback)"
DEVTOOLS_PKG="devtools"
if [[ -z "${BUILDTOOL}" ]] || [[ "${BUILDTOOL}" = makepkg ]]; then
DEVTOOLS="devtools-20210202-3-any"
DEVTOOLS_PKG="$ARCHIVEURL/${BUILDTOOL:0:1}/${DEVTOOLS}.pkg.tar${pkg##*tar}"
elif [[ "${BUILDTOOL}" = devtools ]] ; then
DEVTOOLS="${BUILDTOOL}-${BUILDTOOLVER}"
DEVTOOLS_PKG="$ARCHIVEURL/${BUILDTOOL:0:1}/${DEVTOOLS}.pkg.tar${pkg##*tar}"
fi
msg2 "Using devtools version: %s" "${DEVTOOLS}"

if [[ ${format} -ne 1 && ${format} -ne 2 ]]; then
error "unsupported BUILDINFO format or no format definition found, aborting rebuild"
exit 1
Expand Down Expand Up @@ -473,7 +485,11 @@ pacstrap -G -U /mnt --needed "\$@"
# Ignore all dependencies since we only want the file
# Saves us a few seconds and doesn't download a bunch of things
# we are getting rid off
pacman --noconfirm --needed -Sddu devtools
if [[ "$DEVTOOLS_PKG" == https* ]]; then
pacman --noconfirm --needed -Udd "$DEVTOOLS_PKG"
else
pacman --noconfirm --needed -Sddu "$DEVTOOLS_PKG"
fi
cp -v /usr/share/devtools/makepkg-x86_64.conf /mnt/etc/makepkg.conf
__END__
lock_close 9 "$KEYRINGCACHE/$keyring_package.lock"
Expand Down

0 comments on commit a561c1d

Please sign in to comment.