This repository was archived by the owner on Apr 25, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public_nic = `ip r get 1.1.1.1 | head -n 1 | cut -d ' ' -f 5`.strip! || "eth0"
3737public_cidr = `ip r | grep "dev $(ip r get 1.1.1.1 | head -n 1 | cut -d ' ' -f 5) .* scope link" | cut -d ' ' -f 1` . strip! || "192.168.0.0/24"
3838public_gw = `ip r | grep "^default" | head -n 1 | cut -d ' ' -f 3` . strip! || "192.168.0.1"
3939*prefix , _ = public_gw . split ( "." )
40- vb_public_nic = `VBoxManage list bridgedifs | grep "^Name:.*#{ public_nic } " | cut -d "Name:[ ]*" -f 2 ` . strip! if which "VBoxManage"
40+ vb_public_nic = `VBoxManage list bridgedifs | grep "^Name:.*#{ public_nic } " | awk '{$1=""; sub(/^[[:space:]]+/, ""); print}' ` . strip! if which "VBoxManage"
4141
4242qemu_version = ""
4343qemu_version = `qemu-system-x86_64 --version | perl -pe '($_)=/([0-9]+([.][0-9]+)+)/'` if which "qemu-system-x86_64"
Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ function _get_box_current_version {
2727 version=$( grep " ^${name} .*$PROVIDER " ./ci/pinned_vagrant_boxes.txt | awk ' { print $2 }' )
2828 else
2929 until [ " $version " ]; do
30- metadata=" $( curl -s " https://app.vagrantup. com/api/v1/box/ $ name" ) "
30+ metadata=" $( curl -s " https://vagrantcloud. com/api/v2/vagrant/ ${ name%/* } / ${name #*/ } " ) "
3131 if [ " $metadata " ]; then
32- version=" $( echo " $metadata " | python -c ' import json,sys;print(json.load(sys.stdin)["current_version"]["version"])' ) "
32+ version=" $( echo " $metadata " | python3 -c ' import json,sys;print(json.load(sys.stdin)["current_version"]["version"])' ) "
3333 break
3434 elif [ ${attempt_counter} -eq ${max_attempts} ]; then
3535 echo " Max attempts reached"
@@ -43,13 +43,23 @@ function _get_box_current_version {
4343 echo " ${version#* v} "
4444}
4545
46+ function _get_box_arch {
47+ case " $( uname -m) " in
48+ x86_64) echo " amd64" ;;
49+ aarch64) echo " arm64" ;;
50+ * ) uname -m ;;
51+ esac
52+ }
53+
4654function _vagrant_pull {
4755 local alias=" $1 "
4856 local name=" $2 "
57+ local arch
4958
5059 version=$( _get_box_current_version " $name " )
60+ arch=$( _get_box_arch)
5161
52- if [ " $( curl " https://app.vagrantup. com/${name%/* } /boxes/${name#*/ } /versions/$version /providers/$PROVIDER .box" -o /dev/null -w ' %{http_code}\n' -s) " == " 302" ] && [ " $( vagrant box list | grep -c " $name .*$PROVIDER , $version " ) " != " 1" ]; then
62+ if [ " $( curl " https://vagrantcloud. com/${name%/* } /boxes/${name#*/ } /versions/$version /providers/$PROVIDER / $arch /vagrant .box" -o /dev/null -w ' %{http_code}\n' -s) " == " 302" ] && [ " $( vagrant box list | grep -c " $name .*$PROVIDER , $version " ) " != " 1" ]; then
5363 vagrant box remove --provider " $PROVIDER " --all --force " $name " || :
5464 vagrant box add --provider " $PROVIDER " --box-version " $version " " $name "
5565 elif [ " $( vagrant box list | grep -c " $name .*$PROVIDER , $version " ) " == " 1" ]; then
You can’t perform that action at this time.
0 commit comments