Commit 3a96b595 authored by Boris Yumankulov's avatar Boris Yumankulov Committed by Vitaly Lipatov

epm play snap_get_pkgurl: add multiarch support (eterbug #17702)

parent 70a6d1b2
......@@ -144,8 +144,16 @@ install_pack_pkgurl()
snap_get_pkgurl()
{
local SNAPNAME="$1"
case "$(epm print info -a)" in
x86_64)
local ARCH="amd64" ;;
aarch64)
local ARCH="arm64" ;;
*)
local ARCH="$(epm print info -a)" ;;
esac
is_url "$SNAPNAME" && SNAPNAME="$(basename "$SNAPNAME")"
eget -O- -H Snap-Device-Series:16 https://api.snapcraft.io/v2/snaps/info/$SNAPNAME | epm --inscript tool json -b | grep '\["channel-map",0,"download","url"\]' | head -n1 | sed -e 's|.*"\(.*\)"$|\1|'
eget -O- -H Snap-Device-Series:16 https://api.snapcraft.io/v2/snaps/info/$SNAPNAME | epm --inscript tool json -b | grep -A 8 "$ARCH" | grep '\["channel-map",[0-9],"download","url"\]' | head -n1 | sed 's/.*"\(https:\/\/.*\)".*/\1/'
}
# return version only for the first package
......
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