From 2edb4e8ca8caae836bc0f9eae36639eb5be3b967 Mon Sep 17 00:00:00 2001 From: einschmidt <30439938+einschmidt@users.noreply.github.com> Date: Thu, 26 Nov 2020 13:52:30 +0100 Subject: [PATCH 1/5] Allow --version to overwrite addon version --- builder.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 7805926..58e0a96 100755 --- a/builder.sh +++ b/builder.sh @@ -440,7 +440,6 @@ function build_addon() { local build_arch=$1 local build_from="" - local version="" local image="" local repository="" local raw_image="" @@ -474,9 +473,13 @@ function build_addon() { name="$(jq --raw-output '.name // empty' "$TARGET/config.json" | sed "s/'//g")" description="$(jq --raw-output '.description // empty' "$TARGET/config.json" | sed "s/'//g")" url="$(jq --raw-output '.url // empty' "$TARGET/config.json")" - version="$(jq --raw-output '.version' "$TARGET/config.json")" raw_image="$(jq --raw-output '.image // empty' "$TARGET/config.json")" mapfile -t supported_arch < <(jq --raw-output '.arch // empty' "$TARGET/config.json") + + # Read version from config.json when empty + if [ -z "$VERSION" ] + version="$(jq --raw-output '.version' "$TARGET/config.json")" + fi # Check arch if [[ ! ${supported_arch[*]} =~ ${build_arch} ]]; then @@ -799,6 +802,8 @@ while [[ $# -gt 0 ]]; do ;; --addon) BUILD_TYPE="addon" + VERSION=$2 + shift ;; --base) BUILD_TYPE="base" From c5d9c5a26aa8ac055fc8b22fda5947b92df761e0 Mon Sep 17 00:00:00 2001 From: einschmidt <30439938+einschmidt@users.noreply.github.com> Date: Thu, 26 Nov 2020 14:11:46 +0100 Subject: [PATCH 2/5] Update builder.sh --- builder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder.sh b/builder.sh index 58e0a96..f188c9f 100755 --- a/builder.sh +++ b/builder.sh @@ -477,7 +477,7 @@ function build_addon() { mapfile -t supported_arch < <(jq --raw-output '.arch // empty' "$TARGET/config.json") # Read version from config.json when empty - if [ -z "$VERSION" ] + if [ -z "$VERSION" ]; then version="$(jq --raw-output '.version' "$TARGET/config.json")" fi From 0a6b0ed73f0c10d4a92d48708e1eacf9db8b5562 Mon Sep 17 00:00:00 2001 From: einschmidt <30439938+einschmidt@users.noreply.github.com> Date: Thu, 26 Nov 2020 18:47:05 +0100 Subject: [PATCH 3/5] Update builder.sh --- builder.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/builder.sh b/builder.sh index f188c9f..553c5d7 100755 --- a/builder.sh +++ b/builder.sh @@ -802,8 +802,6 @@ while [[ $# -gt 0 ]]; do ;; --addon) BUILD_TYPE="addon" - VERSION=$2 - shift ;; --base) BUILD_TYPE="base" From 34f161d7c8c8c81682f3f6dacfde0e8ef59ae1d3 Mon Sep 17 00:00:00 2001 From: einschmidt <30439938+einschmidt@users.noreply.github.com> Date: Tue, 1 Dec 2020 18:39:11 +0100 Subject: [PATCH 4/5] Updated variables --- builder.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/builder.sh b/builder.sh index 553c5d7..f4cbc08 100755 --- a/builder.sh +++ b/builder.sh @@ -444,6 +444,7 @@ function build_addon() { local repository="" local raw_image="" local name="" + local version="" local description="" local url="" local args="" @@ -476,8 +477,10 @@ function build_addon() { raw_image="$(jq --raw-output '.image // empty' "$TARGET/config.json")" mapfile -t supported_arch < <(jq --raw-output '.arch // empty' "$TARGET/config.json") - # Read version from config.json when empty - if [ -z "$VERSION" ]; then + # Read version from config.json when VERSION is not set + if [ -n "$VERSION" ]; then + version="$VERSION" + else version="$(jq --raw-output '.version' "$TARGET/config.json")" fi From 4efa1caa4a940b09ca472265eb435a502ca156a8 Mon Sep 17 00:00:00 2001 From: einschmidt <30439938+einschmidt@users.noreply.github.com> Date: Tue, 1 Dec 2020 18:41:47 +0100 Subject: [PATCH 5/5] Update builder.sh --- builder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder.sh b/builder.sh index f4cbc08..b7bb252 100755 --- a/builder.sh +++ b/builder.sh @@ -440,11 +440,11 @@ function build_addon() { local build_arch=$1 local build_from="" + local version="" local image="" local repository="" local raw_image="" local name="" - local version="" local description="" local url="" local args=""