From 75656758a51dc8d25469b7064349cd958df46d42 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 20 Nov 2024 11:37:16 +0100 Subject: [PATCH] fix: [monujo] allow installation of version 1.0.0 The source repository was not selected correctly because of ``sort -V`` failing to sort semantic versions. --- monujo/lib/common | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/monujo/lib/common b/monujo/lib/common index 9b4048e..1ef0efb 100644 --- a/monujo/lib/common +++ b/monujo/lib/common @@ -1,11 +1,11 @@ - +# -*- mode: shell-script -*- APP_NAME=monujo SOURCE_URL="https://docker.0k.io/downloads" LOCATION="$SERVICE_CONFIGSTORE/opt/apps/$APP_NAME" CONFIGFILE="$LOCATION/config.json" -version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } +version_gt() { test "$(semver "$@" | head -n 1)" != "$1"; } monujo:get_source_url() { @@ -35,11 +35,14 @@ monujo:code_init() { fi fi if [ -d "$LOCATION" ]; then - find "$LOCATION" -mindepth 1 -delete + find "$LOCATION" -mindepth 1 -delete || return 1 else - mkdir -p "$LOCATION" + mkdir -p "$LOCATION" || return 1 fi - cd "$LOCATION" + cd "$LOCATION" || { + err "Couldn't cd to '$LOCATION'." + return 1 + } source_url="$(monujo:get_source_url "$APP_NAME" "$version")" info "Downloading '$source_url'." wget -q "$source_url" -O file.tar.bz2 || {