commit 7fc037412f124e9a87c03cf61193d5f7a1e41832
parent 0f8fe05fb38c18d81fcecea28e14c7f9d6852779
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sun, 15 Nov 2026 00:01:49 +0530
parent 0f8fe05fb38c18d81fcecea28e14c7f9d6852779
Author: Bharatvaj Hemanth <bharatvaj@yahoo.com>
Date: Sun, 15 Nov 2026 00:01:49 +0530
Sort Debian checksum metadata for immutable reproducible releases
7 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Unix/minimal-fxa-server/APKBUILD b/Unix/minimal-fxa-server/APKBUILD @@ -1,6 +1,6 @@ pkgname=minimal-fxa-server pkgver=0_git20260225 -pkgrel=5 +pkgrel=6 # Explicit Debian output opt-in; upstream's underscore version is not Debian-valid. deb_pkgver=0+git20260225 deb_postinst=debian.postinst
diff --git a/Unix/saait/APKBUILD b/Unix/saait/APKBUILD @@ -1,6 +1,6 @@ pkgname=saait pkgver=0.8 -pkgrel=1 +pkgrel=2 deb_pkgver=$pkgver deb_depends="libc6" pkgdesc="The most boring static HTML page generator"
diff --git a/Unix/sqlite-memory/APKBUILD b/Unix/sqlite-memory/APKBUILD @@ -1,6 +1,6 @@ pkgname=sqlite-memory pkgver=1.3.6 -pkgrel=1 +pkgrel=2 deb_pkgver=$pkgver deb_depends="libc6, libstdc++6, libcurl4t64, sqlite-vector" pkgdesc="Persistent searchable memory for AI agents as a SQLite extension (local and remote embeddings)"
diff --git a/Unix/sqlite-vector/APKBUILD b/Unix/sqlite-vector/APKBUILD @@ -1,6 +1,6 @@ pkgname=sqlite-vector pkgver=1.2.0 -pkgrel=1 +pkgrel=2 deb_pkgver=$pkgver deb_depends="libc6" pkgdesc="SQLite extension for vector search"
diff --git a/noarch/initify/APKBUILD b/noarch/initify/APKBUILD @@ -1,6 +1,6 @@ pkgname=initify pkgver=0_git20220129 -pkgrel=2 +pkgrel=3 deb_pkgver=0+git20220129 deb_depends="perl" pkgdesc="Convert simple systemd services to OpenRC init scripts"
diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh @@ -55,7 +55,7 @@ if [ -n "${deb_postinst:-}" ]; then case "$deb_postinst" in */* | .* | *[!a-zA-Z0-9_.-]*) die 'Unsafe deb_postinst filename' ;; esac install -m755 "$(dirname "$recipe")/$deb_postinst" "$work/stage/DEBIAN/postinst" fi -(cd "$work/stage" && find . -type f ! -path './DEBIAN/*' -exec md5sum {} +) > "$work/stage/DEBIAN/md5sums" +(cd "$work/stage" && find . -type f ! -path './DEBIAN/*' -exec md5sum {} + | LC_ALL=C sort) > "$work/stage/DEBIAN/md5sums" artifact=$output/${pkgname}_${debversion}_${debarch}.deb find "$work/stage" -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} + dpkg-deb --root-owner-group --build "$work/stage" "$artifact"
diff --git a/tests/deb-backend.sh b/tests/deb-backend.sh @@ -29,6 +29,8 @@ package() { mkdir -p "$pkgdir/usr/bin" printf '#!/bin/sh\necho fixture\n' > "$pkgdir/usr/bin/deb-fixture" chmod 755 "$pkgdir/usr/bin/deb-fixture" + mkdir -p "$pkgdir/usr/share/deb-fixture" + for name in a b c; do printf '%s\n' "$name" > "$pkgdir/usr/share/deb-fixture/$name"; done } RECIPE "$root/scripts/build.sh" -f deb -t x86_64-unknown-linux-gnu -o "$work/out" "$work/recipe/APKBUILD" > "$work/build.log" 2>&1 @@ -36,8 +38,11 @@ file=$work/out/x86_64-unknown-linux-gnu/deb-fixture_1.0-2_amd64.deb [ "$(dpkg-deb -f "$file" Package)" = deb-fixture ] [ "$(dpkg-deb -f "$file" Version)" = 1.0-2 ] [ "$(dpkg-deb -f "$file" Architecture)" = amd64 ] -dpkg-deb -c "$file" | grep -q 'root/root.*usr/bin/deb-fixture' +dpkg-deb -c "$file" > "$work/contents" +grep -q 'root/root.*usr/bin/deb-fixture' "$work/contents" [ "$(sha256sum "$file" | awk '{print $1}')" = "$(awk 'NR==1{print $1}' "$file.sha256")" ] +dpkg-deb -e "$file" "$work/control" +LC_ALL=C sort -c "$work/control/md5sums" sleep 2 "$root/scripts/build.sh" -f deb -t x86_64-unknown-linux-gnu -o "$work/repeated" "$work/recipe/APKBUILD" > "$work/repeated.log" 2>&1 cmp "$file" "$work/repeated/x86_64-unknown-linux-gnu/deb-fixture_1.0-2_amd64.deb" @@ -68,5 +73,6 @@ printf '\narch="noarch"\n' >> "$work/recipe/APKBUILD" "$root/scripts/build.sh" -f deb -t x86_64-unknown-linux-gnu -o "$work/noarch" "$work/recipe/APKBUILD" > "$work/noarch.log" 2>&1 all=$work/noarch/x86_64-unknown-linux-gnu/deb-fixture_1.0-2_all.deb [ "$(dpkg-deb -f "$all" Architecture)" = all ] -dpkg-deb -c "$all" | grep -q 'root/root.*usr/bin/deb-fixture' +dpkg-deb -c "$all" > "$work/all-contents" +grep -q 'root/root.*usr/bin/deb-fixture' "$work/all-contents" echo 'PASS: rootless Debian metadata/ownership, noarch staging, checksums, target/opt-in guards, publication, status and corrupt-cache rebuild'
: nply/foundationpkgs