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

generate_common.sh: fix updater-ng version detection

The implementation was invalid because it scanned only first line in
whole range. This new one scans every line in range for version field so
it correctly locates version.
parent d082f442
Branches
Tags
1 merge request!123Turris OS 5.0 (HBK)
......@@ -75,7 +75,7 @@ updater_ng_repodetect() {
local REPO="$1"
local BOARD="${2:-mox}"
local VERSION="$(curl "https://repo.turris.cz/$REPO/packages/$BOARD/turrispackages/Packages" | \
awk '/^Package: updater-ng$/,/^$/ ^^ $1 == "Version:" { gsub(/-.*$/,"",$2); print $2 }')"
awk '/^Package: updater-ng$/,/^$/ { if ($1 == "Version:") { gsub("-.*$","",$2); print $2 } }')"
if [ -z "$VERSION" ]; then
echo "Detection of updater-ng version from repository failed. Using $UPDATER_VERSION instead."
else
......
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