From 17fb66cd8bc168cabb0a87a6b5ebebf3df4508ee Mon Sep 17 00:00:00 2001 From: native-api Date: Sun, 14 Sep 2025 07:23:41 +0300 Subject: [PATCH] Support curl from a snap (#3329) --- plugins/python-build/bin/python-build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() {