Skip to content

Commit

Permalink
UBUNTU: [Packaging] file-downloader not handling positive failures co…
Browse files Browse the repository at this point in the history
…rrectly

Seems we are not handling positive failures such as 404 correctly.  Add
--fail to get server reported errors converted into errors.

BugLink: https://bugs.launchpad.net/bugs/1878897
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
  • Loading branch information
Andy Whitcroft authored and Thadeu Lima de Souza Cascardo committed Jan 29, 2021
1 parent e257432 commit 289670c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debian/scripts/file-downloader
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ do

echo "II: $what $url"

curl --silent --show-error "$url" -o "$to" -D "$to.hdr" || exit 1
curl --silent --fail --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'

0 comments on commit 289670c

Please sign in to comment.