Fix download-logs template

- Do not insert an extra slash into the download URL, this breaks on
  some storage providers.
- Do not try to uncompress *.xz files, libcurl cannot handle that
  compression, also these are mostly journal files that are compressed
  for a good reason.
- Mention the download directory again at the end, avoids needing to
  scroll through umpteen log messages in order to find out the name of
  the tmpdir generated at the start of the script.

Change-Id: I8eb674121a9808dfc8edfc14b8c3525a77b518ab
This commit is contained in:
Dr. Jens Harbott 2020-06-01 11:49:22 +00:00
parent 76eda39210
commit a0927f70c8

View File

@ -65,8 +65,15 @@ EOF
function save_file {
local base_url="$1"
local file="$2"
local xtra_args="--compressed"
curl -s --compressed --create-dirs -o "${file}" "${base_url}/${file}"
{#
# Do not uncompress .xz, libcurl cannot handle it
#}
if [[ "${file}" == *.xz ]]; then
xtra_args=""
fi
curl -s ${xtra_args} --create-dirs -o "${file}" "${base_url}${file}"
{#
# Using --compressed we will send an Accept-Encoding: gzip header
# and the data will come to us across the network compressed.
@ -114,4 +121,4 @@ done
popd >/dev/null
log "Download complete!"
log "Download to ${DOWNLOAD_DIR} complete!"