diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 494fe5b8..67191cd2 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -458,7 +458,14 @@ http_head_curl() { } http_get_curl() { - curl -q -o "${2:--}" -sSLf ${CURL_OPTS} "$1" + local out; + # Curl is also available as a snap. Snaps cannot read or write /tmp + # (files cannot be found, any write result is silently discarded). + local curl_is_snap; + if [[ $(command -v curl) == "/snap/"* ]]; then curl_is_snap=1; fi + if [[ -n $2 && -n $curl_is_snap ]]; then out="$HOME/$(basename "$2")"; else out="$2"; fi + curl -q -o "${out:--}" -sSLf ${CURL_OPTS} "$1" || return $? + if [[ -n $out && -n $curl_is_snap ]]; then mv "$out" "$2"; fi } http_head_wget() {