tmp=$(mktemp)
trap "rm -f $tmp" HUP PIPE INT QUIT TERM EXIT
+hashers=$(echo "$BASS_HASHERS" | head -1)
while [ $# -ne 0 ] ; do
arg="$1"
shift
*)
printf %d:%s, $(printf %s "$arg" | wc -c) "$arg"
esac
-done | meta4ra-hash -hashers "$META4RA_HASHERS" >$tmp
-read hsh rem <$tmp
+done | "$DISTFILES"/bin/hashes-gen "$hashers" >$tmp
+read _name hsh <$tmp
[ -n "$hsh" ]
perl -MMIME::Base64 \
-e 'print MIME::Base64::encode_base64url(pack "H*", "'$hsh'") . "\n";'
#!/bin/sh -e
# List available download URLs for specified meta/target
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../..
+[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
sname=$0 . "$BASS_ROOT"/lib/rc
redo-ifchange $1/urls
hashers="$1"
[ -n "$hashers" ] || hashers="$(meta4ra-hashers-detect 2>/dev/null)"
+if command -v meta4ra-hash >/dev/null 2>/dev/null ; then
+ meta4ra-hash -all -hashers "$hashers"
+ exit
+fi
tmp=$(mktemp -d)
trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
cd $tmp
#!/bin/sh -e
# Generate metadir from specified file
-[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../../..
+[ -n "$BASS_ROOT" ] || BASS_ROOT="$(dirname "$(realpath -- "$0")")"/../../..
sname=$0 . "$BASS_ROOT"/lib/rc
[ -n "$1" ]
dst=$(basename $1)
mkdir -p $dst
"$BASS_ROOT"/bin/filessize $1 >$dst/size
-meta4ra-hash -all -hashers "$META4RA_HASHERS" <$1 >$dst/hashes
+"$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" <$1 >$dst/hashes
if [ -s "$metadir"/hashes ] ; then
meta4ra-check \
-progress \
- -hashers "$META4RA_HASHERS" \
+ -hashers "$BASS_HASHERS" \
-plain "$metadir"/hashes \
<cache/$dst 2>&1 >/dev/null || {
echo hash check failed >&2
echo trying ${url}... >&2
if [ -s "$metadir"/hashes ] ; then
meta4ra-dl -progress -size $size "$url" |
- meta4ra-check -plain -hashers "$META4RA_HASHERS" "$metadir"/hashes \
+ meta4ra-check -plain -hashers "$BASS_HASHERS" "$metadir"/hashes \
>$fn || {
echo hash check failed >&2
rm $fn
trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
echo $namenhash | tee $tmp/name |
- meta4ra-hash -hashers "$META4RA_HASHERS" -all >$tmp/name.hashes
+ "$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" >$tmp/name.hashes
cat >$tmp/buildinfo <<EOF
$BASS_REV
EOF
-meta4ra-hash -hashers "$META4RA_HASHERS" -all <$tmp/buildinfo >$tmp/buildinfo.hashes
+"$DISTFILES"/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 ; } |
-{ meta4ra-hash -hashers "$META4RA_HASHERS" -all || touch $tmp/tar-pipe-failed
+{ "$DISTFILES"/bin/hashes-gen "$BASS_HASHERS" || touch $tmp/tar-pipe-failed
} >$tmp/$namenhash.hashes
[ ! -e $tmp/tar-pipe-failed ]
$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 "$META4RA_HASHERS" $opts $NAMENHASH ||
+ meta4ra-check -hashers "$BASS_HASHERS" $opts $NAMENHASH ||
touch untar-failed
} | $TAR xf - || touch untar-failed
else
[ -d "$dst" ]
arch="$(basename -- "$2")"
[ -n "$arch" ] || arch=$ARCH
+hashers=$(echo "$BASS_HASHERS" | head -1)
tmp=$(mktemp -d ${TMPDIR:-/tmp}/cp-arch.XXXXXX)
trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT
oursize=$("$BASS_ROOT"/bin/filessize $pkg)
theirsize=$("$BASS_ROOT"/bin/filessize "$dst"/$arch/$base)
if [ "$oursize" -eq "$theirsize" ] ; then
- meta4ra-hash -hashers "$META4RA_HASHERS" <$pkg >$tmp/hshour &
- meta4ra-hash -hashers "$META4RA_HASHERS" <"$dst"/$arch/$base >$tmp/hshtheir &
+ "$DISTFILES"/bin/hashes-gen "$hashers" <$pkg >$tmp/hshour &
+ "$DISTFILES"/bin/hashes-gen "$hashers" <"$dst"/$arch/$base >$tmp/hshtheir &
wait
read hshour <$tmp/hshour
read hshtheir <$tmp/hshtheir
slow SHA2 family of algorithms. Let's precompute a bunch of them. We
will use meta4ra-hash utility:
- $ meta4ra-hash -all <$tarball >$DISTFILES/meta/$tarball/hashes
+ $ $DISTFILES/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:
Current BASS'es source code revision.
A [Index/Variables] SETLOCK\r
- A [Index/Variables] META4RA_HASHERS\r
+ A [Index/Variables] BASS_HASHERS\r
A [Index/Variables] FSYNC\r
A [Index/Variables] TAR\r
A [Index/Variables] TMPDIR\r
- * $SETLOCK, $META4RA_HASHERS, $FSYNC, $TAR, $TMPDIR
+ * $SETLOCK, $BASS_HASHERS, $FSYNC, $TAR, $TMPDIR
And of course they could be overridden in most cases with your $BASS_RC.
}
fi
-export META4RA_HASHERS="${META4RA_HASHERS:-$(meta4ra-hashers-detect 2>/dev/null)}"
+export BASS_HASHERS="${BASS_HASHERS:-$(meta4ra-hashers-detect 2>/dev/null)}"
export FSYNC=${FSYNC:-$(command -v fsync 2>/dev/null || command -v sync)}
export TAR=${TAR:-bsdtar}