python2->python3 fixes in install_tool

This commit is contained in:
David Tomaschik
2020-04-16 20:47:50 -07:00
parent fc120b66fe
commit 9178794de5

View File

@@ -170,7 +170,7 @@ case ${TOOL} in
;;
mitmproxy)
makedest_or_die
ver=$(python -c 'import urllib2; import json; print(json.load(urllib2.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["tag_name"].replace("v",""))')
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/mitmproxy/mitmproxy/releases/latest"))["tag_name"].replace("v",""))')
download \
"https://snapshots.mitmproxy.org/${ver}/mitmproxy-${ver}-linux.tar.gz" \
/tmp/mitmproxy.tar.gz
@@ -214,7 +214,7 @@ case ${TOOL} in
;;
cyberchef)
makedest
src=$(python -c 'import urllib2; import json; print(filter(lambda x: x["name"]=="cyberchef.htm", json.load(urllib2.urlopen("https://api.github.com/repos/gchq/CyberChef/releases/latest"))["assets"])[0]["browser_download_url"])')
src=$(python3 -c 'from urllib import request; import json; print(filter(lambda x: x["name"]=="cyberchef.htm", json.load(request.urlopen("https://api.github.com/repos/gchq/CyberChef/releases/latest"))["assets"])[0]["browser_download_url"])')
download "${src}" "${DESTDIR}/cyberchef.html"
;;
apktool)
@@ -280,7 +280,7 @@ case ${TOOL} in
;;
cura)
makedest
ver=$(python -c 'import urllib2; import json; print(json.load(urllib2.urlopen("https://api.github.com/repos/Ultimaker/Cura/releases/latest"))["name"].replace("v",""))')
ver=$(python3 -c 'from urllib import request; import json; print(json.load(request.urlopen("https://api.github.com/repos/Ultimaker/Cura/releases/latest"))["name"].replace("v",""))')
echo "Latest Cura is ${ver}"
download \
"https://github.com/Ultimaker/Cura/releases/download/${ver}/Ultimaker_Cura-${ver}.AppImage" \