Fix usage of Archive repo snapshot

We were not patching the correct mirrorlist and therefore the Archive repo snapshot was not honored in the build...
Also adding some debug visibility to ease future debug sessions
This commit is contained in:
Robin Candau 2026-04-23 19:42:41 +02:00
parent 87c0211ad4
commit 04ef2406be
No known key found for this signature in database
GPG Key ID: FDC3040B92ACA748
2 changed files with 7 additions and 3 deletions

View File

@ -9,6 +9,9 @@ declare -r DOWNLOAD="$4"
declare -r TITLE="$5"
declare -rx SOURCE_DATE_EPOCH="$6"
# For eventual debugging purposes
echo "SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}"
# Do not use these directly in the sed below - it will mask git failures
BUILD_VERSION="${BUILD_VERSION:-dev}"
CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}"

View File

@ -10,6 +10,9 @@ declare -r OUTPUTDIR="$3"
declare -r ARCHIVE_SNAPSHOT="$4"
declare -rx SOURCE_DATE_EPOCH="$5"
# For eventual debugging purposes
echo -e "ARCHIVE_SNAPSHOT: ${ARCHIVE_SNAPSHOT}\nSOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}"
mkdir -vp "$BUILDDIR/alpm-hooks/usr/share/libalpm/hooks"
find /usr/share/libalpm/hooks -exec ln -sf /dev/null "$BUILDDIR/alpm-hooks"{} \;
@ -37,7 +40,7 @@ ln -fs /usr/lib/os-release "$BUILDDIR/etc/os-release"
# Use archived repo snapshot from archive.archlinux.org for reproducible builds
if [[ "$GROUP" == "repro" ]]; then
sed -i "1iServer = https://archive.archlinux.org/repos/$ARCHIVE_SNAPSHOT/\\\$repo/os/\\\$arch" "$BUILDDIR/etc/pacman.d/mirrorlist"
sed -i "1iServer = https://archive.archlinux.org/repos/$ARCHIVE_SNAPSHOT/\\\$repo/os/\\\$arch" rootfs/etc/pacman.d/mirrorlist
repro_pacman_options=(
--logfile /dev/null
)
@ -57,8 +60,6 @@ $WRAPPER -- chroot "$BUILDDIR" pacman-key --init
$WRAPPER -- chroot "$BUILDDIR" pacman-key --populate
if [[ "$GROUP" == "repro" ]]; then
# Remove archived repo snapshot from the mirrorlist
sed -i '1d' "$BUILDDIR/etc/pacman.d/mirrorlist"
# Clear pacman keyring for reproducible builds
rm -rf "$BUILDDIR"/etc/pacman.d/gnupg/*
# Normalize mtimes