Pass the repository URL into the build container as a file
The mirror guard and the image mirrorlist run inside build-in-container.sh, where the host-side variable does not exist. Write /job/mirror.txt on the host and read it in the container.
This commit is contained in:
parent
f20e8e103a
commit
cbd9790d0f
1 changed files with 3 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ toolroot="$work/tools/root.x86_64"
|
|||
mirror=${ARCHIPELAGO_MIRROR_URL:-'https://mirror.nw-sys.ru/archlinux/$repo/os/$arch'}
|
||||
[[ $mirror != *$'\n'* && $mirror != *$'\r'* ]]
|
||||
printf 'Server = %s\n' "$mirror" > "$toolroot/etc/pacman.d/mirrorlist"
|
||||
# The container script writes the same value into the image; /job is this work dir.
|
||||
printf '%s\n' "$mirror" > "$work/mirror.txt"
|
||||
cat > "$work/update.json" <<'PROFILE'
|
||||
@@UPDATE_PROFILE@@
|
||||
PROFILE
|
||||
|
|
@ -254,6 +256,7 @@ rm -f /job/core/etc/ssh/ssh_host_* /job/core/etc/.pwd.lock
|
|||
# internal build transport must never leak into the image, and a snapshot build
|
||||
# must not silently fall back to the rolling mirror - that is what broke updates
|
||||
# on already deployed hosts when the mirror pruned a pinned package.
|
||||
mirror=$(cat /job/mirror.txt)
|
||||
case $mirror in
|
||||
'https://mirror.nw-sys.ru/archlinux'*|'https://mirror.nw-sys.ru/archipelago/arch-repo-snapshot/'*) ;;
|
||||
*) echo "Installed-system repository must be mirror.nw-sys.ru, got: $mirror" >&2; exit 1 ;;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue