Skip to content

Commit 01f7980

Browse files
committed
packages - follow redirects for curl remote package checks
This fixes setting package date for redream and not updating unless needed. The download function already had the --location parameter, but the packaging code for checking for a remote file / checking file date didn't.
1 parent 39f6364 commit 01f7980

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scriptmodules/packages.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ function rp_remoteFileExists() {
430430
local ret
431431
# runCurl will cause stderr to be copied to output so we redirect both stdout/stderr to /dev/null.
432432
# any errors will have been captured by runCurl
433-
runCurl --max-time 10 --silent --show-error --fail --head "$url" &>/dev/null
433+
runCurl --location --max-time 10 --silent --show-error --fail --head "$url" &>/dev/null
434434
ret="$?"
435435
if [[ "$ret" -eq 0 ]]; then
436436
return 0
@@ -474,7 +474,7 @@ function rp_getFileDate() {
474474
[[ -z "$url" ]] && return 1
475475
476476
# get last-modified date stripping any CR in the output
477-
local file_date=$(runCurl --silent --fail --head --no-styled-output "$url" | tr -d "\r" | grep -ioP "last-modified: \K.+")
477+
local file_date=$(runCurl --location --silent --fail --head --no-styled-output "$url" | tr -d "\r" | grep -ioP "last-modified: \K.+")
478478
# if there is a date set in last-modified header, then convert to iso-8601 format
479479
if [[ -n "$file_date" ]]; then
480480
file_date="$(date -Iseconds --date="$file_date")"

0 commit comments

Comments
 (0)