opencloudos: 修复下载时不是下载最新的镜像

This commit is contained in:
bin456789 2024-11-29 22:13:51 +08:00
parent 1b830e9e4d
commit 3ab6ad7fca
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -1161,7 +1161,8 @@ Continue?
fi
# iso
filename=$(curl -L $mirror | grep -oP "ubuntu-$releasever.*?-live-server-$basearch_alt.iso" | head -1)
filename=$(curl -L $mirror | grep -oP "ubuntu-$releasever.*?-live-server-$basearch_alt.iso" |
sort -uV | tail -1 | grep .)
iso=$mirror/$filename
# 在 ubuntu 20.04 上file 命令检测 ubuntu 22.04 iso 结果是 DOS/MBR boot sector
test_url $iso 'iso raw'
@ -1477,7 +1478,8 @@ Continue with DD?
if is_use_cloud_image; then
# ci
dir=$releasever/images/$basearch
file=$(curl -L $mirror/$dir/ | grep -oP 'OpenCloudOS.*?\.qcow2' | head -1)
file=$(curl -L $mirror/$dir/ | grep -oP 'OpenCloudOS.*?\.qcow2' |
sort -uV | tail -1 | grep .)
eval ${step}_img=$mirror/$dir/$file
else
:
@ -1490,7 +1492,8 @@ Continue with DD?
if is_use_cloud_image; then
# ci
dir=$releasever/isos/GA/$basearch
file=$(curl -L $mirror/$dir/ | grep -oP 'AnolisOS.*?\.qcow2' | head -1)
file=$(curl -L $mirror/$dir/ | grep -oP 'AnolisOS.*?-ANCK\.qcow2' |
sort -uV | tail -1 | grep .)
eval ${step}_img=$mirror/$dir/$file
else
:
@ -1505,7 +1508,8 @@ Continue with DD?
fi
if is_use_cloud_image; then
# ci
name=$(curl -L "$mirror/" | grep -oE "openEuler-$releasever-LTS(-SP[0-9])?" | sort -u | tail -1)
name=$(curl -L "$mirror/" | grep -oE "openEuler-$releasever-LTS(-SP[0-9])?" |
sort -uV | tail -1 | grep .)
eval ${step}_img=$mirror/$name/virtual_machine_img/$basearch/$name-$basearch.qcow2.xz
else
: