Commit d932349c authored by Vitaly Lipatov's avatar Vitaly Lipatov

simplify download via eget, parse result strictly

parent dc705563
......@@ -349,13 +349,11 @@ __epm_play_download_epm_file()
local file="$2"
# use short version (3.4.5)
local epmver="$(epm --short --version)"
local URL="https://eepm.ru/releases/$epmver/app-versions"
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O "$target" "$URL/$file" && return
URL="https://eepm.ru/app-versions"
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O "$target" "$URL/$file"
local URL
for URL in "https://eepm.ru/releases/$epmver/app-versions" "https://eepm.ru/app-versions" ; do
info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O "$target" "$URL/$file" && return
done
}
......
......@@ -27,7 +27,8 @@ get_latest_version()
{
URL="https://eepm.ru/app-versions"
#update_url_if_need_mirrored
epm tool eget -q -O- "$URL/$1"
# TODO: check eget result, use only 200 OK
epm tool eget -q -O- "$URL/$1" | head -n1 | cut -d" " -f1
}
__check_for_epm_version()
......
......@@ -75,12 +75,14 @@ is_supported_arch()
get_latest_version()
{
local ver
local epmver="$(epm --short --version)"
local URL="https://eepm.ru/releases/$epmver/app-versions"
eget -q -O- "$URL/$1" && return
URL="https://eepm.ru/app-versions"
eget -q -O- "$URL/$1"
local URL
for URL in "https://eepm.ru/releases/$epmver/app-versions" "https://eepm.ru/app-versions" ; do
# TODO: check eget result, use only 200 OK
ver="$(eget -q -O- "$URL/$1" | head -n1 | cut -d" " -f1)"
[ -n "$ver" ] && echo "$ver" && return
done
}
print_product_alt()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment