[pacman-dev] [PATCH] makepkg: Output full URL in case of download failure

Florian Pritz bluewind at xinu.at
Mon Dec 14 15:52:35 UTC 2015


Most entries in $sources contain variables so finding out why a URL
fails to download is hard because one has to manually replace the
variables when looking at the PKGBUILD. Simply output the full URL here
so that it can be easily seen what is wrong.

Old:
==> ERROR: Failure while downloading example-1.2.4.tar.gz

New:
==> ERROR: Failure while downloading http://example.org/releases/1.1/example-1.2.4.tar.gz

With the new format it is much more obvious that the directory name is
the culprint (1.1 vs 1.2) while the old one would not display that
information.

Signed-off-by: Florian Pritz <bluewind at xinu.at>
---
 scripts/libmakepkg/source/file.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/libmakepkg/source/file.sh.in b/scripts/libmakepkg/source/file.sh.in
index 03dabe6..53b983e 100644
--- a/scripts/libmakepkg/source/file.sh.in
+++ b/scripts/libmakepkg/source/file.sh.in
@@ -71,7 +71,7 @@ download_file() {
 
 	if ! command -- "${cmdline[@]}" >&2; then
 		[[ ! -s $dlfile ]] && rm -f -- "$dlfile"
-		error "$(gettext "Failure while downloading %s")" "$filename"
+		error "$(gettext "Failure while downloading %s")" "$url"
 		plain "$(gettext "Aborting...")"
 		exit 1
 	fi
-- 
2.6.4


More information about the pacman-dev mailing list