*)
printf %d:%s, $(printf %s "$arg" | wc -c) "$arg"
esac
-done | "$DISTFILES"/bin/hashes-gen "$hashers" >$tmp
+done | "$BASS_ROOT"/build/bin/hashes-gen "$hashers" >$tmp
read _name hsh <$tmp
[ -n "$hsh" ]
perl -MMIME::Base64 \
--- /dev/null
+#!/bin/sh -e
+# Check data against provided hashes
+
+hashes="$1"
+[ -s "$hashes" ]
+hashers="$2"
+[ -n "$hashers" ] || hashers="$(meta4ra-hashers-detect 2>/dev/null)"
+tmp=$(mktemp -d)
+trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
+while read name cmd ; do
+ sed -n "s/^$name \(.*\)$/\1/p" <$hashes >$tmp/their
+ if [ -s $tmp/their ] ; then
+ cat >$tmp/hasher <<EOF
+#!/bin/sh -e
+$cmd
+EOF
+ chmod +x $tmp/hasher
+ break
+ fi
+done <<EOF
+$hashers
+EOF
+[ -s $tmp/hasher ] || {
+ echo no common hashes found >&2
+ exit 1
+}
+mkfifo $tmp/pipe
+$tmp/hasher <$tmp/pipe >$tmp/our &
+tee $tmp/pipe
+wait
+read our rem <$tmp/our
+read their <$tmp/their
+[ "$our" = "$their" ] || {
+ echo "hash mismatch: $our != $their" >&2
+ exit 1
+}
dst=$(basename $1)
mkdir -p $dst
"$BASS_ROOT"/bin/filessize $1 >$dst/size
-"$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" <$1 >$dst/hashes
+"$BASS_ROOT"/build/bin/hashes-gen "$BASS_HASHERS" <$1 >$dst/hashes
if [ -r cache/$dst ] ; then
echo using cache/$dst... >&2
if [ -s "$metadir"/hashes ] ; then
- meta4ra-check \
- -progress \
- -hashers "$BASS_HASHERS" \
- -plain "$metadir"/hashes \
- <cache/$dst 2>&1 >/dev/null || {
+ $PV cache/$dst |
+ "$BASS_ROOT"/build/bin/hashes-check "$metadir"/hashes "$BASS_HASHERS" \
+ 2>&1 >/dev/null || {
echo hash check failed >&2
exit 1
- }
+ }
else
echo warning: no $metadir/hashes >&2
if [ -s "$metadir"/size ] ; then
echo trying ${url}... >&2
if [ -s "$metadir"/hashes ] ; then
meta4ra-dl -progress -size $size "$url" |
- meta4ra-check -plain -hashers "$BASS_HASHERS" "$metadir"/hashes \
+ "$BASS_ROOT"/build/bin/hashes-check "$metadir"/hashes "$BASS_HASHERS" \
>$fn || {
echo hash check failed >&2
rm $fn
v1.5.0 >/dev/null
p=gnu/packages/patches/gcc-4-compile-with-gcc-5.patch
( cd ../repo/guix.git ; git archive @ $p | tar xfO - $p ) >$3
-meta4ra-check -pipe $1.meta4 $1 <$3 >/dev/null
+../../bin/hashes-check $1.hashes "$BASS_HASHERS" <$3 >/dev/null
--- /dev/null
+blake3-256 0cba0a01e2201c78ff5f803a3a4d64ff3ec19c35f49f1ea8556e050a453ac770
+blake2b-512 aeb809e7801aa2625bfd814c950a0a302cfb1ee9147d9b32e5d858e7ba34d9b193becd00472a148e3be5fe4c388370de9ac0d4022d38ac42537ce42dda50ebe3
+blake2b-256 2bf78b04c60c32a4e4263074ddb5511d530648ce88f5e27ca5f7493d512c3da0
+skein-512 3b3715c9579625272d3b505fde2655a9307473ef3785415c9c0866baad924aa2407e31f53979b0d8d7fa2a17d0fb81f016fe8cdb6b0f7d54b0a98b654aad521a
+shake128 31c9e64268463d4ddd73a5e743493a2b0dcfda87728b20f68eedcb98512786a3
+shake256 fffa62fc68476dcae4dc1b3c9065c7ad970c01756485da216aa61951a65cdaa62a6bdec4ef37b9d349657e504d5d19112a18d84cf6eced36dbc3c195a768317c
+sha-512 04c38b68ccce8642259011bb8dc73d51f980e2b60c80941e5125bd5d5e68f1693f7d599c10abb5106d789c66130e314115963474465e451be3a20d618016e661
+sha-256 5b084cfc9741d960bd57d799758a98a5f1f436e38308aac2299b439de0a90103
+streebog-512 615fb79a7a3082e4192d9d319c3fd038ed281f3aedd9abec4848f1b35e6de56d8c5c022ed0b24209460dc4538aa6aeeb2001d290be0b4689114151bef3e1bbac
+streebog-256 f7b6b9ce119c2b0c793731051c9d015393981568d6a724567bc4d596c14464d0
+xxh3-128 57b1e630fdfc601b9b146d3bbf7f130a
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<metalink xmlns="urn:ietf:params:xml:ns:metalink">
- <file name="gcc-4-compile-with-gcc-5.patch">
- <hash type="blake3-256">0cba0a01e2201c78ff5f803a3a4d64ff3ec19c35f49f1ea8556e050a453ac770</hash>
- <hash type="blake2b-512">aeb809e7801aa2625bfd814c950a0a302cfb1ee9147d9b32e5d858e7ba34d9b193becd00472a148e3be5fe4c388370de9ac0d4022d38ac42537ce42dda50ebe3</hash>
- <hash type="blake2b-256">2bf78b04c60c32a4e4263074ddb5511d530648ce88f5e27ca5f7493d512c3da0</hash>
- <hash type="skein-512">3b3715c9579625272d3b505fde2655a9307473ef3785415c9c0866baad924aa2407e31f53979b0d8d7fa2a17d0fb81f016fe8cdb6b0f7d54b0a98b654aad521a</hash>
- <hash type="shake128">31c9e64268463d4ddd73a5e743493a2b0dcfda87728b20f68eedcb98512786a3</hash>
- <hash type="shake256">fffa62fc68476dcae4dc1b3c9065c7ad970c01756485da216aa61951a65cdaa62a6bdec4ef37b9d349657e504d5d19112a18d84cf6eced36dbc3c195a768317c</hash>
- <hash type="sha-512">04c38b68ccce8642259011bb8dc73d51f980e2b60c80941e5125bd5d5e68f1693f7d599c10abb5106d789c66130e314115963474465e451be3a20d618016e661</hash>
- <hash type="sha-256">5b084cfc9741d960bd57d799758a98a5f1f436e38308aac2299b439de0a90103</hash>
- <hash type="streebog-512">615fb79a7a3082e4192d9d319c3fd038ed281f3aedd9abec4848f1b35e6de56d8c5c022ed0b24209460dc4538aa6aeeb2001d290be0b4689114151bef3e1bbac</hash>
- <hash type="streebog-256">f7b6b9ce119c2b0c793731051c9d015393981568d6a724567bc4d596c14464d0</hash>
- <hash type="xxh3-128">57b1e630fdfc601b9b146d3bbf7f130a</hash>
- <size>2264</size>
- </file>
-</metalink>
trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
echo $namenhash | tee $tmp/name |
- "$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" >$tmp/name.hashes
+ "$BASS_ROOT"/build/bin/hashes-gen "$BASS_HASHERS" >$tmp/name.hashes
cat >$tmp/buildinfo <<EOF
$BASS_REV
EOF
-"$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" <$tmp/buildinfo >$tmp/buildinfo.hashes
+"$BASS_ROOT"/build/bin/hashes-gen "$BASS_HASHERS" <$tmp/buildinfo >$tmp/buildinfo.hashes
chmod -R a-w $namenhash
{
} |
{ $COMPRESSOR || touch $tmp/tar-pipe-failed ; } |
{ tee $tmp/$namenhash || touch $tmp/tar-pipe-failed ; } |
-{ "$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" || touch $tmp/tar-pipe-failed
+{ "$BASS_ROOT"/build/bin/hashes-gen "$BASS_HASHERS" || touch $tmp/tar-pipe-failed
} >$tmp/$namenhash.hashes
[ ! -e $tmp/tar-pipe-failed ]
tmp=$(mktemp -d "$SKELBINS"/$ARCH/tmp/$NAMENHASH.XXXXXX)
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.hashes || $TAR xf $skelpkg bin.meta4
- [ -s bin.hashes ] && opts="-plain bin.hashes" || opts="-pipe bin.meta4"
- $TAR xfO $skelpkg bin | {
- meta4ra-check -hashers "$BASS_HASHERS" $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
+ $TAR xf $skelpkg bin.hashes
+ $TAR xfO $skelpkg bin | {
+ "$BASS_ROOT"/build/bin/hashes-check bin.hashes "$BASS_HASHERS" ||
+ touch untar-failed
+ } | $TAR xf - || touch untar-failed
[ ! -e untar-failed ]
- rm -f $fn.meta4
+ rm -f $fn.hashes
find $tmp/$namenhash -type f -or -type d -exec $FSYNC {} +
chmod +w $tmp/$NAMENHASH
mv $tmp/$NAMENHASH "$SKELBINS"/$ARCH/$NAMENHASH ||
oursize=$("$BASS_ROOT"/bin/filessize $pkg)
theirsize=$("$BASS_ROOT"/bin/filessize "$dst"/$arch/$base)
if [ "$oursize" -eq "$theirsize" ] ; then
- "$DISTFILES"/bin/hashes-gen "$hashers" <$pkg >$tmp/hshour &
- "$DISTFILES"/bin/hashes-gen "$hashers" <"$dst"/$arch/$base >$tmp/hshtheir &
+ "$BASS_ROOT"/build/bin/hashes-gen "$hashers" <$pkg >$tmp/hshour &
+ "$BASS_ROOT"/build/bin/hashes-gen "$hashers" <"$dst"/$arch/$base >$tmp/hshtheir &
wait
read hshour <$tmp/hshour
read hshtheir <$tmp/hshtheir
$ stat -f %z $tarball >$DISTFILES/meta/$tarball/size
$ stat -f %z $tarball.sig >$DISTFILES/meta/$tarball.sig/size
-A [Index/Programs] meta4ra-create\r
Compute its checksum. There is no preferred algorithm. One could be
satisfied with non-cryptographic, but very fast XXH3. Somebody want
to use fast cryptographic BLAKE3 or BLAKE2. Somebody likes Skein.
Somebody requires GOST Streebog ones. Maybe there are people preferring
slow SHA2 family of algorithms. Let's precompute a bunch of them. We
-will use meta4ra-hash utility:
+will use hashes-gen script:
- $ $DISTFILES/bin/hashes-gen <$tarball >$DISTFILES/meta/$tarball/hashes
+ $ $BASS_ROOT/build/bin/hashes-gen <$tarball >$DISTFILES/meta/$tarball/hashes
Then we must store a list of URLs where it can be fetched. That may be
just trivial:
[ -d $SKELBINS/$ARCH ] || mkdir -p $SKELBINS/$ARCH
export SKELPKGS=${SKELPKGS:-"$BASS_ROOT"/build/pkg}
+[ -n "$PV" ] || command -v pv >/dev/null 2>/dev/null && PV=pv || PV=cat
+
# Program to use for downloading distfiles: "meta4ra", "wget", "aria2c".
export DISTFILE_FETCHER="${DISTFILE_FETCHER:-meta4ra}"
if ! type FETCHER_URLS_SORT 2>/dev/null >/dev/null ; then