Skip to content
Snippets Groups Projects
Verified Commit 62b88ab7 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

helpers/new_release: fix invalid match for modification date

Fields should be compared case insensitive as they can be in any such
format. Using awk instead to compare and correctly parse HTTP head
format.

There is known problem with this code and that is it can't parse
date-time formats with colons. The reason is that printing original
string ($0) in awk sneaks in to it some unwanted characters such as \r
and probably others that are not considered as whitespaces by date
command. This way we take only text.
parent 91dcc004
1 merge request!253Draft: Hotfix/new release date
......@@ -72,7 +72,10 @@ fetch_files() {
GIT_HASH_LISTS="$FETCH_DIR/git-hash-lists"
GIT_HASH_PACKAGES="$FETCH_DIR/git-hash-packages"
TOS_VERSION="$FETCH_DIR/tos-version"
local release_date_raw="$(curl -s --head "$REPO/$branch/mox/packages/git-hash.sig" | sed -n 's/^Last-Modified: //p')"
local release_date_raw
release_date_raw="$(
curl -s --head "$REPO/$branch/mox/packages/git-hash.sig" | \
awk -F: 'tolower($1) == "last-modified" { $1=""; print $2; exit }')"
RELEASE_DATE="$(date --iso-8601=second -d "$release_date_raw")"
for board in "${BOARDS[@]}"; do
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment