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() ...@@ -349,13 +349,11 @@ __epm_play_download_epm_file()
local file="$2" local file="$2"
# use short version (3.4.5) # use short version (3.4.5)
local epmver="$(epm --short --version)" local epmver="$(epm --short --version)"
local URL="https://eepm.ru/releases/$epmver/app-versions" 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" info "Updating local IPFS DB in $eget_ipfs_db file from $URL/eget-ipfs-db.txt"
docmd eget -q -O "$target" "$URL/$file" && return docmd eget -q -O "$target" "$URL/$file" && return
done
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"
} }
......
...@@ -27,7 +27,8 @@ get_latest_version() ...@@ -27,7 +27,8 @@ get_latest_version()
{ {
URL="https://eepm.ru/app-versions" URL="https://eepm.ru/app-versions"
#update_url_if_need_mirrored #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() __check_for_epm_version()
......
...@@ -75,12 +75,14 @@ is_supported_arch() ...@@ -75,12 +75,14 @@ is_supported_arch()
get_latest_version() get_latest_version()
{ {
local ver
local epmver="$(epm --short --version)" local epmver="$(epm --short --version)"
local URL="https://eepm.ru/releases/$epmver/app-versions" local URL
eget -q -O- "$URL/$1" && return for URL in "https://eepm.ru/releases/$epmver/app-versions" "https://eepm.ru/app-versions" ; do
# TODO: check eget result, use only 200 OK
URL="https://eepm.ru/app-versions" ver="$(eget -q -O- "$URL/$1" | head -n1 | cut -d" " -f1)"
eget -q -O- "$URL/$1" [ -n "$ver" ] && echo "$ver" && return
done
} }
print_product_alt() 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