]> Sergey Matveev's repositories - bass.git/commitdiff
Simpler checksums inside packages
authorSergey Matveev <stargrave@stargrave.org>
Fri, 6 Mar 2026 14:01:46 +0000 (17:01 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 6 Mar 2026 18:50:57 +0000 (21:50 +0300)
build/lib/mk-pkg
build/lib/pkg-inst
doc/Build/skelpkg

index b1cea2ae5e91ad65b1c3dd027cede9202bacb2e33889580570358fec82429e27..f9afc8259d30a61c4f51e04068220481d805a2a3faaaefe427e9e6db22f09e91 100755 (executable)
@@ -5,7 +5,7 @@
 # other skels after that script exits. All its write permissions are
 # dropped. $namenhash is saved in "name", current commit revision is
 # saved in "buildinfo" and $namenhash in "bin", with corresponding
-# .meta4 checksum files. Resulting skelpkg it written to stdout.
+# .hashes checksum files. Resulting skelpkg it written to stdout.
 
 # Copyright (C) 2024-2026 Sergey Matveev <stargrave@stargrave.org>
 #               2024-2026 Elena Balakhonova <balakhonova.e.v@yandex.ru>
@@ -38,13 +38,11 @@ tmp=$(mktemp -d $TMPDIR/$namenhash-mk-pkg.XXXXXX)
 trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
 
 echo $namenhash | tee $tmp/name |
-    meta4ra-create -no-published -no-generator -hashes "$META4RA_HASHES" \
-        -fn name >$tmp/name.meta4
+    meta4ra-hash -hashes "$META4RA_HASHES" -all >$tmp/name.hashes
 cat >$tmp/buildinfo <<EOF
 $BASS_REV
 EOF
-meta4ra-create -no-published -no-generator -hashes "$META4RA_HASHES" \
-    -fn buildinfo <$tmp/buildinfo >$tmp/buildinfo.meta4
+meta4ra-hash -hashes "$META4RA_HASHES" -all <$tmp/buildinfo >$tmp/buildinfo.hashes
 
 chmod -R a-w $namenhash
 {
@@ -53,14 +51,13 @@ chmod -R a-w $namenhash
 } |
 { $COMPRESSOR || touch $tmp/tar-pipe-failed ; } |
 { tee $tmp/$namenhash || touch $tmp/tar-pipe-failed ; } |
-{ meta4ra-create -no-published -no-generator -fn $namenhash \
-    -hashes "$META4RA_HASHES" || touch $tmp/tar-pipe-failed
-} >$tmp/$namenhash.meta4
+{ meta4ra-hash -hashes "$META4RA_HASHES" -all || touch $tmp/tar-pipe-failed
+} >$tmp/$namenhash.hashes
 [ ! -e $tmp/tar-pipe-failed ]
 
 cd $tmp
 mv $namenhash bin
-mv $namenhash.meta4 bin.meta4
-totar="name name.meta4 buildinfo buildinfo.meta4 bin.meta4 bin"
+mv $namenhash.hashes bin.hashes
+totar="name name.hashes buildinfo buildinfo.hashes bin.hashes bin"
 chmod a-w $totar
 "$BASS_ROOT"/build/contrib/detpax/detpax $totar
index 74e98335817377be4d69962cc696d4c16f4d2dc6949d7d533e9ca899d3724ffd..23ea2225420645d3c46612678a25733f265aa6f9f36909042777b4672eb757bb 100755 (executable)
@@ -43,12 +43,14 @@ else
     trap "$BASS_ROOT/bin/rm-r $tmp" HUP PIPE INT QUIT TERM EXIT
     cd $tmp
     if command -v meta4ra-check >/dev/null ; then
-        $TAR xf $skelpkg bin.meta4
+        $TAR xf $skelpkg bin.hashes || $TAR xf $skelpkg bin.meta4
+        [ -s bin.hashes ] && opts="-plain bin.hashes" || opts="-pipe bin.meta4"
         $TAR xfO $skelpkg bin | {
-            meta4ra-check -hashes "$META4RA_HASHES" -pipe bin.meta4 $NAMENHASH ||
+            meta4ra-check -hashes "$META4RA_HASHES" $opts $NAMENHASH ||
             touch untar-failed
         } | $TAR xf - || touch untar-failed
     else
+        echo warning: skipping checksum verification >&2
         $TAR xfO $skelpkg bin | $TAR xf - || touch untar-failed
     fi
     [ ! -e untar-failed ]
index 0fd4eafeae4d969f98bfdad9affe74e32f8f99d95b4a07565f035348333e3712..8e78be59eb4a200e2be1150af81cc886b8d920583472bd08236f1ac153be2d5c 100644 (file)
@@ -16,13 +16,13 @@ metadata. Similarly to Arch Linux and
 skelpkg is a single file, uncompressed POSIX pax archive with following
 entries:
 
-* name, name.meta4
+* name, name.hashes
   Full name of the skelbin directory, $NAME-$hsh.
   With an optional checksum file.
-* buildinfo, buildinfo.meta4
+* buildinfo, buildinfo.hashes
   Just a textual information how that skelbin/skelpkg was built.
   Currently just a current BASS'es commit revision.
-* bin.meta4, bin
+* bin.hashes, bin
   Compressed POSIX pax archive containing the skelbin
   ($NAME-$hsh/ directory hierarchy).
 
@@ -41,13 +41,7 @@ to place the largest "bin" file at the very end of the archive. And that
 is why the outer archive is not compressed -- to easily seek among its
 entries.
 
-A [Index/Concepts] Metalink4\r
-A [Index/Programs] meta4\r
-=> https://datatracker.ietf.org/doc/html/rfc5854 Metalink4\r
-XML-based format is used to keep integrity checksums for files. It is
-well supported format by various tools and it is capable of storing
-multiple checksums simultaneously. That allows us to keep both Streebog
-hashes and much more faster ones.
+.hashes files contain "name hex(hash)" lines with various file checksums.
 
 Nothing prevents you from extending it with additional files, for
 example holding cryptographic signatures.