From 891dc31c922267479ca680bfb7185b3a415180d8 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 8 May 2021 19:47:03 +0300 Subject: [PATCH] Report cache filename at download In certain cases, a user wants to know the cached filename to add the file themselves, see https://github.com/pyenv/pyenv/issues/1743 . Since we report both a filename and a URL anyway, there's no reason to report a wrong one. --- plugins/python-build/bin/python-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index ec14dec9..8596d8af 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -417,8 +417,8 @@ fetch_tarball() { fi if ! reuse_existing_tarball "$package_filename" "$checksum"; then - local tarball_filename="$(basename "$package_url")" - echo "Downloading ${tarball_filename}..." >&2 + # Report the cached file name -- sometimes, it's useful to know (#1743) + echo "Downloading ${package_filename}..." >&2 http head "$mirror_url" && download_tarball "$mirror_url" "$package_filename" "$checksum" || download_tarball "$package_url" "$package_filename" "$checksum"