mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
(cherry picked from commit 53d4e27aea)
Signed-off-by: GildedRoach <GildedRoach@users.noreply.github.com>
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=0.15.0-dev.1254+c9ce1debe
|
||||
|
||||
# Self explanatory
|
||||
function randomize_mirrors() {
|
||||
mirrors=("https://pkg.machengine.org/zig" "https://zigmirror.hryx.net/zig" "https://zig.linus.dev/zig" "https://zig.squirl.dev" "https://zig.florent.dev")
|
||||
number=${#mirrors[@]}
|
||||
index=$(( RANDOM % number ))
|
||||
mirror=${mirrors[$index]}
|
||||
}
|
||||
|
||||
# ONLY export mirrors to the update scripts if they connect on both files
|
||||
until curl -If $mirror/zig-${version}.tar.xz &>/dev/null && curl -If $mirror/zig-${version}.tar.xz.minisig &>/dev/null; do
|
||||
randomize_mirrors
|
||||
done
|
||||
|
||||
echo $mirror
|
||||
|
||||
exit 0
|
||||
@@ -4,10 +4,4 @@ let v = json.master.version;
|
||||
rpm.global("ver", v);
|
||||
if rpm.changed() {
|
||||
rpm.release();
|
||||
// Update the Zig version in the script
|
||||
sh(`sed -i 's/version=.*/version=${v}/' anda/langs/zig/bootstrap/choose-mirror.sh`, #{});
|
||||
// This could be done with the rhai-rand Crate but Anda does not use this currently
|
||||
let mirror = sh("anda/langs/zig/bootstrap/choose-mirror.sh", #{"stdout": "piped"}).ctx.stdout;
|
||||
mirror.pop();
|
||||
rpm.global("mirror_url", mirror);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
%global zig_install_options %zig_build_options %{shrink: \
|
||||
--prefix "%{_prefix}" \
|
||||
}
|
||||
%global mirror_url https://zig.squirl.dev
|
||||
%global zig_mirrors ("https://pkg.machengine.org/zig" "https://zigmirror.hryx.net/zig" "https://zig.linus.dev/zig" "https://zig.squirl.dev" "https://zig.florent.dev")
|
||||
%global mirror_url %(mirrors=%{zig_mirrors}; index=$(( RANDOM % ${#mirrors[@]} )); echo ${mirrors[$index]})
|
||||
|
||||
Name: zig-master-bootstrap
|
||||
Version: %(echo %{ver} | sed 's/-/~/g')
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import "andax/bump_extras.rhai" as bump;
|
||||
|
||||
rpm.version(bump::madoguchi("zig-master-bootstrap", labels.branch));
|
||||
if rpm.changed() {
|
||||
// This could be done with the rhai-rand Crate but Anda does not use this currently
|
||||
let mirror = sh("anda/langs/zig/bootstrap/choose-mirror.sh", #{"stdout": "piped"}).ctx.stdout;
|
||||
mirror.pop();
|
||||
rpm.global("mirror_url", mirror);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
%bcond docs %{without bootstrap}
|
||||
%bcond test 1
|
||||
%global zig_cache_dir %{builddir}/zig-cache
|
||||
%global mirror_url https://zig.squirl.dev
|
||||
%global zig_mirrors ("https://pkg.machengine.org/zig" "https://zigmirror.hryx.net/zig" "https://zig.linus.dev/zig" "https://zig.squirl.dev" "https://zig.florent.dev")
|
||||
%global mirror_url %(mirrors=%{zig_mirrors}; index=$(( RANDOM % ${#mirrors[@]} )); echo ${mirrors[$index]})
|
||||
|
||||
Name: zig-master
|
||||
Version: 0.15.0~dev.1254+c9ce1debe
|
||||
|
||||
Reference in New Issue
Block a user