[PATCH 3/3 B][SRU] UBUNTU: [packaging] file-downloader -- handle server errors correctly

Alberto Milone alberto.milone at canonical.com
Fri May 29 14:36:16 UTC 2020


From: Andy Whitcroft <apw at canonical.com>

It seems that curl needs to be persuaded to to expose some kinds of
errors.  Add the --fail option to the curl command line.

BugLink: http://bugs.launchpad.net/bugs/1850958
Signed-off-by: Andy Whitcroft <apw at canonical.com>
Signed-off-by: Alberto Milone <alberto.milone at canonical.com>
---
 debian/scripts/file-downloader | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/scripts/file-downloader b/debian/scripts/file-downloader
index 46ae96237205..1eb49339fd4d 100755
--- a/debian/scripts/file-downloader
+++ b/debian/scripts/file-downloader
@@ -20,7 +20,7 @@ do
 
 	echo "II: $what $url"
 
-	curl --silent --show-error "$url" -o "$to" -D "$to.hdr" || exit 1
+	curl --fail --silent --show-error "$url" -o "$to" -D "$to.hdr" || exit 1
 	redirect=$(awk '/^Location: / {gsub(/^[[:space:]]+|[[:space:]]+$/,"",$2); print $2;}' "$to.hdr")
 	[ -z "$redirect" ] && break
 	what='  following'
-- 
2.25.1




More information about the kernel-team mailing list