From: Sergey Matveev Date: Mon, 16 Feb 2026 20:45:09 +0000 (+0300) Subject: Use an improved meta4ra X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c0815bcb805172e5c3e5c4bd3f6461ef01f40378a658df6f4003d94ba5ba0e30;p=bass.git Use an improved meta4ra Ability to sort download URLs, multiple attempts to download. --- diff --git a/build/distfiles/.gitignore b/build/distfiles/.gitignore index 048ee60..24426e4 100644 --- a/build/distfiles/.gitignore +++ b/build/distfiles/.gitignore @@ -171,7 +171,7 @@ /meson-0.56.0.tar.gz /meson-0.63.3.tar.gz /meson-1.7.2.tar.gz -/meta4ra-0.12.0.tar.zst +/meta4ra-1.0.0.tar.zst /MIME-Base32-1.303.tar.gz /mkvtoolnix-58.0.0.tar.xz /mod_tile-v0.7.0-58-gc3453bc.tar.zst diff --git a/build/distfiles/default.rc b/build/distfiles/default.rc index a586bcf..f1af523 100644 --- a/build/distfiles/default.rc +++ b/build/distfiles/default.rc @@ -1,29 +1,41 @@ if [ -r predownloaded/$1 ] ; then echo Using predownloaded/$1... >&2 - meta4ra-check -hashes "$META4RA_HASHES" -meta4 $1.meta4 predownloaded/$1 >&2 + meta4ra-check -hashes "$META4RA_HASHES" $1.meta4 predownloaded/$1 >&2 ln predownloaded/$1 $3 exit 0 fi if [ -e $1.meta4 ] ; then - if [ "$META4_FETCHER" = "meta4ra-check" ] ; then - meta4ra-check -progress -dl 0 \ - -hashes "$META4RA_HASHES" \ - -meta4 $1.meta4 $(basename $1) - exit - fi meta4=$(realpath $1.meta4) - tmp=$(mktemp -d ${TMPDIR:-/tmp}/$(basename $1).XXXXXX) + fn=$(basename $1) + tmp=$(mktemp -d ${TMPDIR:-/tmp}/$fn.XXXXXX) trap "rm -fr $tmp" HUP PIPE INT QUIT TERM EXIT cd $tmp case "$META4_FETCHER" in + meta4ra) + size=$(meta4ra-list -size $meta4 $fn) + meta4ra-list $meta4 $fn | + meta4ra-url-sort ${META4RA_CC_SORT:-"" rand} | + while read url ; do + echo "trying ${url}..." >&2 + meta4ra-dl -progress -size $size "$url" | + meta4ra-check -pipe -hashes "$META4RA_HASHES" \ + $meta4 $fn >$fn || { + rm $fn + continue + } + break + done + [ -s $fn ] + cat $fn + ;; wget) wget --input-metalink=$meta4 >&2 - cat "$(basename $1).meta4.#1" + cat "$fn.meta4.#1" ;; aria2c) aria2c $meta4 >&2 - cat $(basename $1) + cat $fn ;; *) echo Unknown \$META4_FETCHER >&2 diff --git a/build/distfiles/gcc-4-compile-with-gcc-5.patch.do b/build/distfiles/gcc-4-compile-with-gcc-5.patch.do index b67c195..5d508ad 100644 --- a/build/distfiles/gcc-4-compile-with-gcc-5.patch.do +++ b/build/distfiles/gcc-4-compile-with-gcc-5.patch.do @@ -3,4 +3,4 @@ sname=$1.do . "$BASS_ROOT"/lib/rc [ -d guix.git ] || git clone --depth 1 --bare https://git.savannah.gnu.org/git/guix.git >&2 p=gnu/packages/patches/gcc-4-compile-with-gcc-5.patch ( cd guix.git ; git archive @ $p | tar xfO - $p ) >$3 -meta4ra-check -pipe -meta4 $1.meta4 $1 <$3 >/dev/null +meta4ra-check -pipe $1.meta4 $1 <$3 >/dev/null diff --git a/build/distfiles/meta4ra-0.12.0.tar.zst.meta4 b/build/distfiles/meta4ra-0.12.0.tar.zst.meta4 deleted file mode 100644 index fa4c623..0000000 --- a/build/distfiles/meta4ra-0.12.0.tar.zst.meta4 +++ /dev/null @@ -1,28 +0,0 @@ - - - - dcab22303e5c0249fcf96dc6d1e65d73bf0464bbd5066ca664e4406dbdbc2979 - 862fe656eccf2e86c315cb9fecbf54230094c33a537f77f450c2a72f0859f899797ec29c671ab1400b0d0b34e87fcae1c2cac8a449963a18f0e6d8856419ff58 - 85a627ff1318ec4f0c53e1284580d936cf24b2376e610b2b801ebec80f340ff8 - cf08226b770efc2079e7dd51445105bafe718ee489c8977cba8cc9da185798912143f1643957c28ec7a6ccb30d81ef15f46f1f351bd47801b4d969ee0d314d06 - 9f1518066798b619ab414794ef83ae067e202aed1c6edac4c09feac5d0beccff - 196b89801ab1a1227e1bc5a664316575d08e63edaf44eab38759a4b55edb9ebbd371103b23b3a6be43f776555e0431a2ca79f09eac102e783ad544009e7b7704 - f649872a08f0755fb37357a4833282415b1656499bedf4769a1fa4cbca163602440eadf07bba2e79d10aa84cf147a3dc309c232591865e5a4505e828f256edb9 - 7cde0a60066c96e0abe9271189308a02f227f4412161c7856c54e1af8c5688a3 - 3303b4adba1bb11aca9ca823cf0a1a68d101b6854229f7b51c48df1bc00b9ded01b9c457689b13673786cc979576ec36dcca70f97e2e36e3a485e7f14d121395 - b882b762d7a706067257b6c2b2617d8ea9d576e56229868d12387c5912562aed - 30f976a41cce7924a540f028b351d7b0 - - 473733 - http://www.meta4ra.stargrave.org/download/meta4ra-0.12.0.tar.zst - https://www.meta4ra.stargrave.org/download/meta4ra-0.12.0.tar.zst - http://y.www.meta4ra.stargrave.org/download/meta4ra-0.12.0.tar.zst - - diff --git a/build/distfiles/meta4ra-1.0.0.tar.zst.meta4 b/build/distfiles/meta4ra-1.0.0.tar.zst.meta4 new file mode 100644 index 0000000..65c5afd --- /dev/null +++ b/build/distfiles/meta4ra-1.0.0.tar.zst.meta4 @@ -0,0 +1,28 @@ + + + + e8fc1dada0274b29acfcc0c3301422597acc92a429f2b8ab3ab6ffb0bd88d940 + 6e7cdfe61ebaa68e88cc9a59c40ab6798a8e524a419378af65c4691dd9885bb9cfe88efdfed0ab04d6a5626568aa594f2cc42f112af066606f0554b94b57d026 + 3fe8e06e7669924f739e5b6ef277f11d53745ce8d9c1c1c2af9a515b67247e58 + e0ee9c62aa930b7934aa67101e7340e09721a4217551eda97a917edb5f7f313b1f82261c79dcb52a05c6e8ffa6c0e13f94ac33338dfee7e8d3935ead10f9393e + 37ebbfe18e330eac62f8759e31ad85c6c390cb663e4660f41af91bf79e06acb3 + d514e2b1bd820f52da029339f7490f6d253723f5469c5c84b3c31520c53ff63937c6987d4e27e74233c5815185f815072cbd2526015c4598a18c8f8e4f4a82e3 + d24ae8d46528d0965afc3e82d5af445ba8994ebf1a17fd00a78d8a5cd51e64a6524b2f53681cd14793e2146fba890be191015ca94e309257c1317cebb02c5088 + 976444891ca30bce9779f2667a75a6ba86b377ada3d91e4cdce642db23f5a731 + 847f24c7e866af8ebabd294486051535e2a83ce8ab12f2b0f5af2e0a9a60fae22f4ec22014e16d8d2695964dfd1bb765f233bd73d27784e0f52124f2400f47eb + fa3a391637444b96f3dbae2d453aedcc6d5fc3e4e14d6592733d581a9557a6a9 + 49f69d0caae0b4001ce423e8e444d9ab + + 476243 + http://www.meta4ra.stargrave.org/download/meta4ra-1.0.0.tar.zst + https://www.meta4ra.stargrave.org/download/meta4ra-1.0.0.tar.zst + http://y.www.meta4ra.stargrave.org/download/meta4ra-1.0.0.tar.zst + + diff --git a/build/lib/pkg-inst b/build/lib/pkg-inst index 70094c5..74e9833 100755 --- a/build/lib/pkg-inst +++ b/build/lib/pkg-inst @@ -45,7 +45,7 @@ else if command -v meta4ra-check >/dev/null ; then $TAR xf $skelpkg bin.meta4 $TAR xfO $skelpkg bin | { - meta4ra-check -hashes "$META4RA_HASHES" -pipe -meta4 bin.meta4 $NAMENHASH || + meta4ra-check -hashes "$META4RA_HASHES" -pipe bin.meta4 $NAMENHASH || touch untar-failed } | $TAR xf - || touch untar-failed else diff --git a/build/skel/sysutils/meta4ra-0.12.0.do b/build/skel/sysutils/meta4ra-1.0.0.do similarity index 100% rename from build/skel/sysutils/meta4ra-0.12.0.do rename to build/skel/sysutils/meta4ra-1.0.0.do diff --git a/contrib/prepare-deps/link-from-distfiles b/contrib/prepare-deps/link-from-distfiles index 9813898..78410bd 100755 --- a/contrib/prepare-deps/link-from-distfiles +++ b/contrib/prepare-deps/link-from-distfiles @@ -9,5 +9,5 @@ ln -f ../../../build/distfiles/go1.23.5.tar.gz go1.23.5.src.tar.gz ln -f ../../../build/distfiles/go1.25.6.tar.gz go1.25.6.src.tar.gz ln -f ../../../build/distfiles/go1.26.0.tar.gz go1.26.0.src.tar.gz ln -f ../../../build/distfiles/goredo-2.9.1.tar.zst -ln -f ../../../build/distfiles/meta4ra-0.12.0.tar.zst +ln -f ../../../build/distfiles/meta4ra-1.0.0.tar.zst ln -f ../../../build/distfiles/zstd-1.5.7.tar.gz diff --git a/contrib/prepare-deps/steps/080-meta4ra-0.12.0.dl b/contrib/prepare-deps/steps/080-meta4ra-0.12.0.dl deleted file mode 100644 index 194e1a7..0000000 --- a/contrib/prepare-deps/steps/080-meta4ra-0.12.0.dl +++ /dev/null @@ -1 +0,0 @@ -dodl http://www.meta4ra.stargrave.org/download/$name.tar.zst $name.tar.zst f649872a08f0755fb37357a4833282415b1656499bedf4769a1fa4cbca163602440eadf07bba2e79d10aa84cf147a3dc309c232591865e5a4505e828f256edb9 diff --git a/contrib/prepare-deps/steps/080-meta4ra-0.12.0 b/contrib/prepare-deps/steps/080-meta4ra-1.0.0 similarity index 100% rename from contrib/prepare-deps/steps/080-meta4ra-0.12.0 rename to contrib/prepare-deps/steps/080-meta4ra-1.0.0 diff --git a/contrib/prepare-deps/steps/080-meta4ra-1.0.0.dl b/contrib/prepare-deps/steps/080-meta4ra-1.0.0.dl new file mode 100644 index 0000000..7ab03ea --- /dev/null +++ b/contrib/prepare-deps/steps/080-meta4ra-1.0.0.dl @@ -0,0 +1 @@ +dodl http://www.meta4ra.stargrave.org/download/$name.tar.zst $name.tar.zst d24ae8d46528d0965afc3e82d5af445ba8994ebf1a17fd00a78d8a5cd51e64a6524b2f53681cd14793e2146fba890be191015ca94e309257c1317cebb02c5088 diff --git a/doc/Build/Distfiles b/doc/Build/Distfiles index 3963f10..b355317 100644 --- a/doc/Build/Distfiles +++ b/doc/Build/Distfiles @@ -26,10 +26,10 @@ target. An archive with all of them can be created with .meta4 files can be processed by either of three programs: -* $META4_FETCHER=meta4ra-check - Use "meta4ra-check -dl 0" command to download the first URL. This is - by default, because meta4ra utilities are anyway installed already. It - won't try to download other URLs, unlike other fetch options there! +* $META4_FETCHER=meta4ra + Use "meta4ra-url-sort ${META4RA_CC_SORT:-"" rand} | meta4ra-dl" + command to download the randomised URL, preferring location-less URL. + This is by default, because meta4ra utilities are anyway installed already. * $META4_FETCHER=wget Use wget compiled with --with-metalink option. The only drawback is diff --git a/lib/rc b/lib/rc index e49bc09..bf9598a 100644 --- a/lib/rc +++ b/lib/rc @@ -32,8 +32,8 @@ COMPRESSOR=${COMPRESSOR:-zstdmt} export TMPDIR=${TMPDIR:-/tmp} MAKE_JOBS=${MAKE_JOBS:-$(nproc)} -# Program to use for downloading .meta4 files: "meta4ra-check", "wget", "aria2c". -export META4_FETCHER="${META4_FETCHER:-meta4ra-check}" +# Program to use for downloading .meta4 files: "meta4ra", "wget", "aria2c". +export META4_FETCHER="${META4_FETCHER:-meta4ra}" if command -v fetch >/dev/null 2>/dev/null ; then JUSTDL="fetch -o"