Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion tests/integration/arch-rpr-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,14 @@ for package in "${glibc_only_packages[@]}"; do glibc_only[$package]=1; done
mkdir -p "$history/packages/arch" "$fixture/history-payload/usr/lib/modules/previous" \
"$fixture/history-boot" "$fixture/history-incompatible-boot" \
"$fixture/history-unconstrained-boot" "$fixture/history-wrong-arch-boot" \
"$fixture/history-old-update" "$fixture/history-new-update" "$fixture/history-changed-update"
"$fixture/history-old-update" "$fixture/history-new-update" "$fixture/history-changed-update" \
"$fixture/rebuilt"
fixed_archives=()
for package in paru reliefos-filesystem reliefos-st reliefos-desktop; do
packages=("$output"/packages/arch/"$package"-*.pkg.tar.zst)
[[ ${#packages[@]} == 1 ]]
cp -- "${packages[0]}" "$history/packages/arch/"
fixed_archives+=("${packages[0]##*/}")
done
for package in "${app_packages[@]}"; do
archive=$(<"$output/packages/arch/$package-current")
Expand Down Expand Up @@ -312,7 +315,20 @@ done
cp -- "$fixture/history-new-update/.PKGINFO" "$fixture/history-changed-update/.PKGINFO"
printf 'different package contents\n' > "$fixture/history-changed-update/changed"
docker run --rm --pull=never --read-only --network none --user "$(id -u):$(id -g)" \
--mount "type=bind,src=$history/packages/arch,dst=/archives,readonly" \
--env "RPR_FIXED_ARCHIVES=${fixed_archives[*]}" \
--mount "type=bind,src=$fixture,dst=/fixture" "$image" bash -euc '
set -o pipefail
read -r -a fixed_archives <<< "$RPR_FIXED_ARCHIVES"
for archive in "${fixed_archives[@]}"; do
original=/archives/$archive
rebuilt=/fixture/rebuilt/$archive
zstd -qdc -- "$original" | zstd -q -1 --no-check -c > "$rebuilt"
if cmp -s -- "$original" "$rebuilt"; then
zstd -qdc -- "$original" | zstd -q -1 --check -c > "$rebuilt"
fi
! cmp -s -- "$original" "$rebuilt"
done
tar --zstd -cf "/fixture/$1" -C /fixture/history-payload .PKGINFO usr
tar --zstd -cf "/fixture/$2" -C /fixture/history-old-update .PKGINFO
tar --zstd -cf "/fixture/$3" -C /fixture/history-new-update .PKGINFO
Expand Down Expand Up @@ -354,6 +370,9 @@ for package in "${app_packages[@]}"; do
printf '%s\n' "$old_app" > "$history/packages/arch/$package-current"
done
publish_history
previous_snapshot=$history/rpr-testing/$(<"$history_pointer")
# A rebuild can change the archive bytes without changing the package version.
cp -- "$fixture"/rebuilt/*.pkg.tar.zst "$history/packages/arch/"
printf '%s\n%s\n' "$new_payload" "$new_update" > "$history/packages/arch/reliefos-kernel-current"
printf '%s\n' "$boot" > "$history/packages/arch/reliefos-boot-current"
printf '%s\n' "$runtime" > "$history/packages/arch/libreliefos-current"
Expand All @@ -363,6 +382,13 @@ done
publish_history
published_id=$(<"$history_pointer")
history_snapshot=$history/rpr-testing/$published_id
mkdir -p -- "$history/ci" "$history/pages"
printf '%s\n' "${previous_snapshot##*/}" > "$history/ci/previous-rpr"
cp -al -- "$history_snapshot" "$history/pages/rpr"
bash "$source_root/scripts/ci/restore-rpr.sh" retain "$history"
for archive in "${fixed_archives[@]}"; do
cmp -- "$previous_snapshot/$archive" "$history/pages/rpr/$archive"
done
cmp -- "$fixture/$old_payload" "$history_snapshot/$old_payload"
test -s "$history_snapshot/$old_payload.sig"
tar -tzf "$history_snapshot/rpr.db" > "$scratch/history-db"
Expand Down
8 changes: 6 additions & 2 deletions tools/build/arch-paru.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@ grep -Fxq "depend = libalpm.so=${alpm%%.*}-64" "$pending/pkginfo"
bsdtar -xOf "$archive" usr/bin/paru > "$pending/paru"
chmod 755 "$pending/paru"
"$pending/paru" --version | grep -E '^paru v.+ - libalpm v[0-9]'
mv -fT -- "$archive" "$packages/${archive##*/}"
printf 'paru package: %s/%s\n' "$packages" "${archive##*/}"
published=$packages/${archive##*/}
mv -fT -- "$archive" "$published"
for stale in "$packages"/paru-*-x86_64.pkg.tar.zst{,.sig}; do
[[ $stale == "$published" ]] || rm -f -- "$stale"
done
printf 'paru package: %s\n' "$published"
6 changes: 3 additions & 3 deletions tools/build/arch-rpr-sign.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ source_commit=$(git -C "$source_root" rev-parse --verify 'HEAD^{commit}') ||
for tool in gpg gpgv; do
command -v "$tool" >/dev/null || fail "missing host tool: $tool"
done
fixed_archives=("${archives[@]}")
home=$(realpath -e -- "${RPR_GNUPGHOME:?use a dedicated GnuPG signing home}")
fingerprint=${RPR_SIGNING_FINGERPRINT:?set the full primary signing-key fingerprint}
fingerprint=${fingerprint^^}
Expand All @@ -29,7 +28,7 @@ primary=$("${gpg[@]}" --with-colons --fingerprint --list-secret-keys "$fingerpri

shopt -s nullglob
inputs=()
archives=()
fixed_archives=()
for package in paru:x86_64 reliefos-filesystem:any reliefos-st:x86_64 reliefos-desktop:any; do
name=${package%:*}
arch=${package#*:}
Expand All @@ -38,8 +37,9 @@ for package in paru:x86_64 reliefos-filesystem:any reliefos-st:x86_64 reliefos-d
fail "expected exactly one regular $name archive; run arch-build in this output"
[[ ${candidates[0]##*/} =~ ^[A-Za-z0-9._+-]+$ ]] || fail 'invalid package filename'
inputs+=("${candidates[0]}")
archives+=("${candidates[0]##*/}")
fixed_archives+=("${candidates[0]##*/}")
done
archives=("${fixed_archives[@]}")

runtime_pointer=$output/packages/arch/libreliefos-current
[[ -f $runtime_pointer && ! -L $runtime_pointer ]] || fail 'missing regular runtime package pointer; run arch-build'
Expand Down