From 6ce4516691d0b1549dde140b2c5822991f3be2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Sun, 23 Jul 2023 17:07:56 -0300 Subject: [PATCH 01/18] Improve matching of different image update channels Be explicit in the matching of each of the update channels according to our rules: - Stable channel is always the latest with `prerelease==false` - Testing channel is always teh latest with `prerelease==true` and no bracket tags (i.e. not having `[CHANNEL]` in the name) - Unstable channel is always the latest with `prerelease==true` and the `[UNSTABLE]` bracket tag. - Also allow for custom update channels as needed by adding bracket tags. Even more than one tag can be used on the same release if needed. Tha last match of the function will catch all cases with `[CHANNEL-NAME]` in bracket tags. That includes the `unstable` update channel. --- __frzr-deploy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 5f3e9d0..b1fcc3f 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -15,12 +15,16 @@ get_img_url() { select(.state=="uploaded") ]') - if [ "$CHANNEL" == "testing" ]; then - result=$(echo $result | jq '[ .[] | select(.name|test("UNSTABLE")|not) ]') - elif [ "$CHANNEL" == "stable" ]; then - result=$(echo $result | jq '[ .[] | select(.prerelease==false) ]') - elif [ "$CHANNEL" != "unstable" ]; then - result=$(echo $result | jq "[ .[] | select(.url|contains(\"-${CHANNEL}_\")) ]") + # Filter channels by release naming conventions + if [ "$CHANNEL" == "stable" ]; then + # Check first for stable, this is the latest that have prerelease == false + result=$(echo ${result} | jq '[ .[] | select(.prerelease==false) ]') + elif [ "$CHANNEL" == "testing" ]; then + # Testing channel have prerelease = true and no other tags + result=$(echo ${result} | jq '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ]') + else + # Match any release with CHANNEL as a tag (including unstable) + result=$(echo ${result} | jq "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ]") fi echo $result | jq 'first | .url' | sed 's/"//g' From 6cb3e648d8ee2d60d10fe636e10902aee372e343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Sun, 23 Jul 2023 17:29:06 -0300 Subject: [PATCH 02/18] tests: run.sh: Correct channel on stable and testing cases --- test/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/run.sh b/test/run.sh index b03733e..bb2bc00 100755 --- a/test/run.sh +++ b/test/run.sh @@ -26,14 +26,14 @@ check 'should select the system image asset' $(cat test1.dat | get check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer testing asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test3a.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' +check 'should select asset that is in `uploaded` state' $(cat test3a.dat | get_img_url stable) 'chimeraos-1_0000001.img.tar.xz' echo echo '==== testing channel' check 'should select the system image asset' $(cat test1.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test3b.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' +check 'should select asset that is in `uploaded` state' $(cat test3b.dat | get_img_url testing) 'chimeraos-1_0000001.img.tar.xz' echo echo '==== unstable channel' From 5f50c52374ff3450a7c3032fe00d2088a0707fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Sun, 23 Jul 2023 17:40:46 -0300 Subject: [PATCH 03/18] tests: Each channel requested should be respected Each channel should be respected as the user requested. Even if that means a downgrade from current installed version. That means if the user requested `unstable` it should check for the latest unstable image regardless of stable one. The same goes for `testing`. Each channel will prioritize it's own latest image avobe the stable one. --- test/run.sh | 14 +++++++------- test/test1.dat | 46 ++++++++++++++++++++++++++++++++++++++++++++++ test/test2.dat | 2 +- 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/test/run.sh b/test/run.sh index bb2bc00..ddad2c4 100755 --- a/test/run.sh +++ b/test/run.sh @@ -22,7 +22,7 @@ check() { echo echo '== get_img_url' echo '==== stable channel' -check 'should select the system image asset' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' +check 'should select the system image asset in stable' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer testing asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' @@ -30,16 +30,16 @@ check 'should select asset that is in `uploaded` state' $(cat test3a.dat | get_i echo echo '==== testing channel' -check 'should select the system image asset' $(cat test1.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' -check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' +check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' +check 'should prioritize testing asset over newer stable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000002.img.tar.xz' +check 'should prioritize testing asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000002.img.tar.xz' check 'should select asset that is in `uploaded` state' $(cat test3b.dat | get_img_url testing) 'chimeraos-1_0000001.img.tar.xz' echo echo '==== unstable channel' -check 'should select the system image asset' $(cat test1.dat | get_img_url unstable) 'chimeraos-1_0000000.img.tar.xz' -check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over older unstable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' +check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' +check 'should prioritize unstable asset over newer testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' +check 'should prioritize unstable asset over newer stable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' check 'should select asset that is in `uploaded` state' $(cat test3c.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' echo diff --git a/test/test1.dat b/test/test1.dat index 176544e..fdbb06e 100644 --- a/test/test1.dat +++ b/test/test1.dat @@ -21,5 +21,51 @@ "browser_download_url": "sha256sum.txt" } ] + }, + { + "tag_name": "2_0000000", + "name": "ChimeraOS 2 (0000000)", + "prerelease": true, + "created_at": "2022-05-07T03:31:40Z", + "assets": [ + { + "name": "build_info.txt", + "state": "uploaded", + "browser_download_url": "build_info.txt" + }, + { + "name": "chimeraos-2_0000000.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-2_0000000.img.tar.xz" + }, + { + "name": "sha256sum.txt", + "state": "uploaded", + "browser_download_url": "sha256sum.txt" + } + ] + }, + { + "tag_name": "3_0000000", + "name": "ChimeraOS 3 (0000000) [UNSTABLE]", + "prerelease": true, + "created_at": "2022-05-08T03:31:40Z", + "assets": [ + { + "name": "build_info.txt", + "state": "uploaded", + "browser_download_url": "build_info.txt" + }, + { + "name": "chimeraos-3_0000000.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-3_0000000.img.tar.xz" + }, + { + "name": "sha256sum.txt", + "state": "uploaded", + "browser_download_url": "sha256sum.txt" + } + ] } ] diff --git a/test/test2.dat b/test/test2.dat index 0376917..6442e72 100644 --- a/test/test2.dat +++ b/test/test2.dat @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": true, - "created_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", From efa8b9d2ff4dcbfdbe4769337d62626c2a27e179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Sun, 23 Jul 2023 17:48:41 -0300 Subject: [PATCH 04/18] tests: test4.dat use different dates for relases Having the same timestamp for both entries is not realistic --- test/test4.dat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test4.dat b/test/test4.dat index e8e00ca..e776176 100644 --- a/test/test4.dat +++ b/test/test4.dat @@ -16,7 +16,7 @@ "tag_name": "2_0000002", "name": "ChimeraOS 2 (0000002)", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", From c015fc719acdfa4560953ba425872f7c05041937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Sun, 23 Jul 2023 18:01:00 -0300 Subject: [PATCH 05/18] Add missing case for explicit version numbers Also test case for point releases to select exact match --- __frzr-deploy | 8 ++++++-- test/run.sh | 1 + test/test4.dat | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index b1fcc3f..d39ef77 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -16,8 +16,12 @@ get_img_url() { ]') # Filter channels by release naming conventions - if [ "$CHANNEL" == "stable" ]; then - # Check first for stable, this is the latest that have prerelease == false + if [[ "$CHANNEL" =~ ^[0-9]+\-?[0-9]*$ ]] ; then + # Check first for explicit version numbers between stable releases + # Useful for downgrading + result=$(echo ${result} | jq "[ .[] | select(.prerelease==false) | select(.name|test(\" ${CHANNEL} \"))]") + elif [ "$CHANNEL" == "stable" ]; then + # Check for stable, this is the latest that have prerelease == false result=$(echo ${result} | jq '[ .[] | select(.prerelease==false) ]') elif [ "$CHANNEL" == "testing" ]; then # Testing channel have prerelease = true and no other tags diff --git a/test/run.sh b/test/run.sh index ddad2c4..2db2851 100755 --- a/test/run.sh +++ b/test/run.sh @@ -46,6 +46,7 @@ echo echo '==== direct' check 'should select newest version by default' $(cat test4.dat | get_img_url stable) 'chimeraos-2_0000002.img.tar.xz' check 'should be able to select older versions' $(cat test4.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' +check 'should be able to select older point versions' $(cat test4.dat | get_img_url 1-1) 'chimeraos-1-1_0000011.img.tar.xz' check 'should select latest matching asset' $(cat test4a.dat | get_img_url 1) 'chimeraos-1_0000002.img.tar.xz' check 'should select asset that is in `uploaded` state' $(cat test4b.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' diff --git a/test/test4.dat b/test/test4.dat index e776176..9821cae 100644 --- a/test/test4.dat +++ b/test/test4.dat @@ -12,6 +12,19 @@ } ] }, + { + "tag_name": "1-1_0000011", + "name": "ChimeraOS 1-1 (0000011)", + "prerelease": false, + "created_at": "2021-01-01T10:00:00Z", + "assets": [ + { + "name": "chimeraos-1-1_0000011.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-1-1_0000011.img.tar.xz" + } + ] + }, { "tag_name": "2_0000002", "name": "ChimeraOS 2 (0000002)", From fd1554e82eb8e123ff900616eeb6f420e0efbf6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Fri, 28 Jul 2023 08:58:27 -0300 Subject: [PATCH 06/18] Force source back to stable when successful update This effectively makes any deployment outside stable to be a one time only. The user can always force it conciously each time. That way we add one more hoop to broken setups. --- __frzr-deploy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/__frzr-deploy b/__frzr-deploy index d39ef77..45c2a60 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -316,6 +316,12 @@ main() { echo "deployment complete; restart to boot into ${NAME}" + # Force to stable channel + REPO=$(echo "${SOURCE}" | cut -f 1 -d ':') + CHANNEL="stable" + echo "${REPO}/${CHANNEL}" > "${MOUNT_PATH}/source" + echo "Forced source to stable channel" + umount -R -l ${MOUNT_PATH} } From 296c37bd71f3a22615845fcd04e5aaa0806effa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Fri, 28 Jul 2023 09:03:38 -0300 Subject: [PATCH 07/18] Remove all trailing spaces --- __frzr-deploy | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 45c2a60..f6f2467 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -39,7 +39,7 @@ get_boot_cfg() { local amd_ucode=${2} local intel_ucode=${3} local additional_arguments=${4} - + echo "title ${version} linux /${version}/vmlinuz-linux ${amd_ucode} @@ -55,7 +55,7 @@ get_deployment_to_delete() { local deployment_path=${3} local TO_BOOT=`get_next_boot_deployment ${current_version} ${boot_cfg_path}` - + ls -1 ${deployment_path} | grep -v ${current_version} | grep -v ${TO_BOOT} | head -1 || echo } @@ -116,7 +116,7 @@ main() { ;; esac done - + if [ ! -d /sys/firmware/efi/efivars ]; then echo "Legacy BIOS installs are not supported. Aborting." exit 1 @@ -145,7 +145,7 @@ main() { DEPLOY_PATH=${MOUNT_PATH}/deployments mkdir -p ${DEPLOY_PATH} - + BOOT_CFG="${MOUNT_PATH}/boot/loader/entries/frzr.conf" mkdir -p ${MOUNT_PATH}/boot/loader/entries @@ -173,11 +173,11 @@ main() { else echo "WARNING: source wasn't specified" fi - + if [ "${local_install}" == true ]; then mkdir tmp_source mount -o rw -L FRZR_UPDATE /root/tmp_source - FILE_NAME=$(basename /root/tmp_source/*.img.tar.xz*) + FILE_NAME=$(basename /root/tmp_source/*.img.tar.xz*) NAME=$(echo "${FILE_NAME}" | cut -f 1 -d '.') SUBVOL="${DEPLOY_PATH}/${NAME}" IMG_FILE="/root/tmp_source/${FILE_NAME}" @@ -214,7 +214,7 @@ main() { CHECKSUM=$(curl --http1.1 -L -s "${BASE_URL}/sha256sum.txt" | cut -f -1 -d ' ') SUBVOL="${DEPLOY_PATH}/${NAME}" IMG_FILE="${MOUNT_PATH}/${FILE_NAME}" - + if [ -e ${SUBVOL} ]; then echo "${NAME} already installed; aborting" exit 7 # let Steam know there is no update available @@ -256,7 +256,7 @@ main() { else tar xfO ${IMG_FILE} | btrfs receive --quiet ${DEPLOY_PATH} fi - + mkdir -p ${MOUNT_PATH}/boot/${NAME} cp ${SUBVOL}/boot/vmlinuz-linux ${MOUNT_PATH}/boot/${NAME} cp ${SUBVOL}/boot/initramfs-linux.img ${MOUNT_PATH}/boot/${NAME} @@ -293,17 +293,17 @@ main() { unset -f post_install done fi - + # Export variables to be used by child processes for frzr-tweaks and frzr-initramfs export MOUNT_PATH export SUBVOL export NAME - + # Check if the FIRMWARE_OVERRIDE variable is set by the install media, if so enable firmware overrides if [ -n ${FIRMWARE_OVERRIDE} ]; then echo "export USE_FIRMWARE_OVERRIDES=1" > ${MOUNT_PATH}/etc/device-quirks.conf fi - + # Run frzr-tweaks to execute the device-quirks to be supplied by the deployed images frzr-tweaks From 26489700614a795161b31ba3e67a13f31127f16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Fri, 28 Jul 2023 15:01:25 -0300 Subject: [PATCH 08/18] Allow for always prioritize newer stable release - Replace created_at for published_at for time ordering releases. - Add a check for the date of each channel to compare to current stable. - Fix "stable" releases in tests. They don't have the commit hash in their name. --- __frzr-deploy | 81 ++++++++++++++++++++++++++++++++++++++++--------- test/run.sh | 28 ++++++++--------- test/test1.dat | 8 ++--- test/test2.dat | 10 +++--- test/test3a.dat | 4 +-- test/test3b.dat | 4 +-- test/test3c.dat | 4 +-- test/test4.dat | 12 ++++---- test/test4a.dat | 12 ++++---- test/test4b.dat | 6 ++-- 10 files changed, 109 insertions(+), 60 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index f6f2467..94147c7 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -4,34 +4,87 @@ set -e set -o pipefail get_img_url() { - CHANNEL=$1 + CHANNEL=$1 + + # Order by creation date in reverse + result=$(jq 'sort_by(.published_at) | reverse') + + # Always check for stable date + stable_release_date=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) ] | + first | + .published_at' + ) + # Check for stable url, this is the latest that have prerelease == false + stable_download_url=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) ] | + first | + .assets[] | + select(.browser_download_url | test("img")) | + .browser_download_url' + ) - result=$(jq '[ - sort_by(.created_at) | - reverse | - .[] | - { name: .name, prerelease: .prerelease, state: .assets[].state, url: .assets[].browser_download_url } | - select(.url|test("img")) | - select(.state=="uploaded") - ]') # Filter channels by release naming conventions if [[ "$CHANNEL" =~ ^[0-9]+\-?[0-9]*$ ]] ; then # Check first for explicit version numbers between stable releases # Useful for downgrading - result=$(echo ${result} | jq "[ .[] | select(.prerelease==false) | select(.name|test(\" ${CHANNEL} \"))]") + result=$(echo "${result}" | jq -r "[ .[] | + select(.prerelease==false) | + select(.name|test(\" ${CHANNEL}\$\")) ] | + first | + .assets[] | + select(.browser_download_url | test(\"img\")) | + .browser_download_url" + ) elif [ "$CHANNEL" == "stable" ]; then - # Check for stable, this is the latest that have prerelease == false - result=$(echo ${result} | jq '[ .[] | select(.prerelease==false) ]') + result=$stable_download_url elif [ "$CHANNEL" == "testing" ]; then # Testing channel have prerelease = true and no other tags - result=$(echo ${result} | jq '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ]') + testing_release_date=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) | + select(.name|test("\\[.*\\]")|not) ] | + first | + .published_at' + ) + testing_url=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==true) | + select(.name|test("\\[.*\\]")|not) ] | + first | + .assets[] | + select(.browser_download_url | test("img")) | + .browser_download_url' + ) + if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=testing_url + fi else # Match any release with CHANNEL as a tag (including unstable) result=$(echo ${result} | jq "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ]") + unstable_release_date=$(echo "${result}" | jq -r "[ .[] | + select(.prerelease==true) | + select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | + first | + .published_at" + ) + unstable_url=$(echo "${result}" | jq -r "[ .[] | + select(.prerelease==true) | + select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | + first | + .assets[] | + select(.browser_download_url | test(\"img\")) | + .browser_download_url" + ) + if [ $(date -d $unstable_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=$unstable_url + fi fi - echo $result | jq 'first | .url' | sed 's/"//g' + echo $result } get_boot_cfg() { diff --git a/test/run.sh b/test/run.sh index 2db2851..fbbfcea 100755 --- a/test/run.sh +++ b/test/run.sh @@ -22,33 +22,29 @@ check() { echo echo '== get_img_url' echo '==== stable channel' -check 'should select the system image asset in stable' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' -check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' +check 'should select the system image asset in stable' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' +check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer testing asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test3a.dat | get_img_url stable) 'chimeraos-1_0000001.img.tar.xz' echo echo '==== testing channel' -check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' -check 'should prioritize testing asset over newer stable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000002.img.tar.xz' -check 'should prioritize testing asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000002.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test3b.dat | get_img_url testing) 'chimeraos-1_0000001.img.tar.xz' +check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' +check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' echo echo '==== unstable channel' -check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' -check 'should prioritize unstable asset over newer testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' -check 'should prioritize unstable asset over newer stable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test3c.dat | get_img_url unstable) 'chimeraos-1_0000001.img.tar.xz' +check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' +check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over older unstable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' echo echo '==== direct' -check 'should select newest version by default' $(cat test4.dat | get_img_url stable) 'chimeraos-2_0000002.img.tar.xz' -check 'should be able to select older versions' $(cat test4.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' -check 'should be able to select older point versions' $(cat test4.dat | get_img_url 1-1) 'chimeraos-1-1_0000011.img.tar.xz' -check 'should select latest matching asset' $(cat test4a.dat | get_img_url 1) 'chimeraos-1_0000002.img.tar.xz' -check 'should select asset that is in `uploaded` state' $(cat test4b.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' +check 'should select newest version by default' $(cat test4.dat | get_img_url stable) 'chimeraos-2_0000002.img.tar.xz' +check 'should be able to select older versions' $(cat test4.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' +check 'should be able to select older point versions' $(cat test4.dat | get_img_url 1-1) 'chimeraos-1-1_0000011.img.tar.xz' +check 'should select latest matching asset' $(cat test4a.dat | get_img_url 1) 'chimeraos-1_0000002.img.tar.xz' echo echo '== get_boot_cfg' diff --git a/test/test1.dat b/test/test1.dat index fdbb06e..797f329 100644 --- a/test/test1.dat +++ b/test/test1.dat @@ -1,9 +1,9 @@ [ { "tag_name": "1_0000000", - "name": "ChimeraOS 1 (0000000)", + "name": "ChimeraOS 1", "prerelease": false, - "created_at": "2022-05-05T03:31:40Z", + "published_at": "2022-05-05T03:31:40Z", "assets": [ { "name": "build_info.txt", @@ -26,7 +26,7 @@ "tag_name": "2_0000000", "name": "ChimeraOS 2 (0000000)", "prerelease": true, - "created_at": "2022-05-07T03:31:40Z", + "published_at": "2022-05-07T03:31:40Z", "assets": [ { "name": "build_info.txt", @@ -49,7 +49,7 @@ "tag_name": "3_0000000", "name": "ChimeraOS 3 (0000000) [UNSTABLE]", "prerelease": true, - "created_at": "2022-05-08T03:31:40Z", + "published_at": "2022-05-08T03:31:40Z", "assets": [ { "name": "build_info.txt", diff --git a/test/test2.dat b/test/test2.dat index 6442e72..9ec7481 100644 --- a/test/test2.dat +++ b/test/test2.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001) [UNSTABLE]", "prerelease": true, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": true, - "created_at": "2022-01-02T00:00:00Z", + "published_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "1_0000003", "name": "ChimeraOS 1 (0000003)", "prerelease": false, - "created_at": "2023-01-01T00:00:00Z", + "published_at": "2023-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000003.img.tar.xz", @@ -40,9 +40,9 @@ }, { "tag_name": "1_0000004", - "name": "ChimeraOS 1 (0000004)", + "name": "ChimeraOS 1", "prerelease": false, - "created_at": "2024-01-01T00:00:00Z", + "published_at": "2024-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000004.img.tar.xz", diff --git a/test/test3a.dat b/test/test3a.dat index 383f283..ee4380c 100644 --- a/test/test3a.dat +++ b/test/test3a.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": false, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test3b.dat b/test/test3b.dat index 1619f76..6696e8a 100644 --- a/test/test3b.dat +++ b/test/test3b.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": true, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": true, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test3c.dat b/test/test3c.dat index 7e2994b..2ca3376 100644 --- a/test/test3c.dat +++ b/test/test3c.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001) [UNSTABLE]", "prerelease": true, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002) [UNSTABLE]", "prerelease": true, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test4.dat b/test/test4.dat index 9821cae..82fe90a 100644 --- a/test/test4.dat +++ b/test/test4.dat @@ -1,9 +1,9 @@ [ { "tag_name": "1_0000001", - "name": "ChimeraOS 1 (0000001)", + "name": "ChimeraOS 1", "prerelease": false, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -14,9 +14,9 @@ }, { "tag_name": "1-1_0000011", - "name": "ChimeraOS 1-1 (0000011)", + "name": "ChimeraOS 1-1", "prerelease": false, - "created_at": "2021-01-01T10:00:00Z", + "published_at": "2021-01-01T10:00:00Z", "assets": [ { "name": "chimeraos-1-1_0000011.img.tar.xz", @@ -27,9 +27,9 @@ }, { "tag_name": "2_0000002", - "name": "ChimeraOS 2 (0000002)", + "name": "ChimeraOS 2", "prerelease": false, - "created_at": "2022-01-02T00:00:00Z", + "published_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", diff --git a/test/test4a.dat b/test/test4a.dat index e5fefdc..fa80168 100644 --- a/test/test4a.dat +++ b/test/test4a.dat @@ -1,9 +1,9 @@ [ { "tag_name": "1_0000002", - "name": "ChimeraOS 1 (0000002)", + "name": "ChimeraOS 1", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -14,9 +14,9 @@ }, { "tag_name": "1_0000001", - "name": "ChimeraOS 1 (0000001)", + "name": "ChimeraOS 1", "prerelease": false, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -27,9 +27,9 @@ }, { "tag_name": "2_0000002", - "name": "ChimeraOS 2 (0000002)", + "name": "ChimeraOS 2", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", diff --git a/test/test4b.dat b/test/test4b.dat index 19b2463..fc23a68 100644 --- a/test/test4b.dat +++ b/test/test4b.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": false, - "created_at": "2021-01-01T00:00:00Z", + "published_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "2_0000002", "name": "ChimeraOS 2 (0000002)", "prerelease": false, - "created_at": "2022-01-01T00:00:00Z", + "published_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", From 70af0760919494a4a2f4276681c51b82c5bd4ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Ignacio=20Aramend=C3=ADa?= Date: Fri, 28 Jul 2023 15:10:50 -0300 Subject: [PATCH 09/18] Revert "Force source back to stable when successful update" This reverts commit fd1554e82eb8e123ff900616eeb6f420e0efbf6a. Revert my rant in code. We don't need to force stable, we just need to use a sync install. The users are adults and we should treat them like such with their hardware. --- __frzr-deploy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 94147c7..50c3562 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -369,12 +369,6 @@ main() { echo "deployment complete; restart to boot into ${NAME}" - # Force to stable channel - REPO=$(echo "${SOURCE}" | cut -f 1 -d ':') - CHANNEL="stable" - echo "${REPO}/${CHANNEL}" > "${MOUNT_PATH}/source" - echo "Forced source to stable channel" - umount -R -l ${MOUNT_PATH} } From 378a92bff425bfc061a2fd1a4e3cfd82911c4477 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 12:16:28 +0200 Subject: [PATCH 10/18] fixup testing channel selection --- __frzr-deploy | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 50c3562..12fedea 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -41,12 +41,12 @@ get_img_url() { result=$stable_download_url elif [ "$CHANNEL" == "testing" ]; then # Testing channel have prerelease = true and no other tags - testing_release_date=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==false) | - select(.name|test("\\[.*\\]")|not) ] | - first | - .published_at' - ) + testing_release_date=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==true) | + select(.name|test("\\[.*\\]")|not) ] | + first | + .published_at' + ) testing_url=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ] | @@ -58,7 +58,7 @@ get_img_url() { if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then result=$stable_download_url else - result=testing_url + result=$testing_url fi else # Match any release with CHANNEL as a tag (including unstable) From 54569a0903749a148b0e9f56f013d580224e6802 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 12:16:36 +0200 Subject: [PATCH 11/18] consistent tab usage --- __frzr-deploy | 98 +++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 12fedea..a0a90b5 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -4,32 +4,32 @@ set -e set -o pipefail get_img_url() { - CHANNEL=$1 - - # Order by creation date in reverse - result=$(jq 'sort_by(.published_at) | reverse') - - # Always check for stable date - stable_release_date=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==false) ] | - first | - .published_at' - ) - # Check for stable url, this is the latest that have prerelease == false - stable_download_url=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==false) ] | - first | - .assets[] | - select(.browser_download_url | test("img")) | - .browser_download_url' - ) - - - # Filter channels by release naming conventions - if [[ "$CHANNEL" =~ ^[0-9]+\-?[0-9]*$ ]] ; then - # Check first for explicit version numbers between stable releases - # Useful for downgrading - result=$(echo "${result}" | jq -r "[ .[] | + CHANNEL=$1 + + # Order by creation date in reverse + result=$(jq 'sort_by(.published_at) | reverse') + + # Always check for stable date + stable_release_date=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) ] | + first | + .published_at' + ) + # Check for stable url, this is the latest that have prerelease == false + stable_download_url=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) ] | + first | + .assets[] | + select(.browser_download_url | test("img")) | + .browser_download_url' + ) + + + # Filter channels by release naming conventions + if [[ "$CHANNEL" =~ ^[0-9]+\-?[0-9]*$ ]] ; then + # Check first for explicit version numbers between stable releases + # Useful for downgrading + result=$(echo "${result}" | jq -r "[ .[] | select(.prerelease==false) | select(.name|test(\" ${CHANNEL}\$\")) ] | first | @@ -37,17 +37,17 @@ get_img_url() { select(.browser_download_url | test(\"img\")) | .browser_download_url" ) - elif [ "$CHANNEL" == "stable" ]; then - result=$stable_download_url - elif [ "$CHANNEL" == "testing" ]; then - # Testing channel have prerelease = true and no other tags + elif [ "$CHANNEL" == "stable" ]; then + result=$stable_download_url + elif [ "$CHANNEL" == "testing" ]; then + # Testing channel have prerelease = true and no other tags testing_release_date=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ] | first | .published_at' ) - testing_url=$(echo "${result}" | jq -r '[ .[] | + testing_url=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ] | first | @@ -55,21 +55,21 @@ get_img_url() { select(.browser_download_url | test("img")) | .browser_download_url' ) - if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then - result=$stable_download_url - else - result=$testing_url - fi - else - # Match any release with CHANNEL as a tag (including unstable) - result=$(echo ${result} | jq "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ]") + if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=$testing_url + fi + else + # Match any release with CHANNEL as a tag (including unstable) + result=$(echo ${result} | jq "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ]") unstable_release_date=$(echo "${result}" | jq -r "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | first | .published_at" ) - unstable_url=$(echo "${result}" | jq -r "[ .[] | + unstable_url=$(echo "${result}" | jq -r "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | first | @@ -77,14 +77,14 @@ get_img_url() { select(.browser_download_url | test(\"img\")) | .browser_download_url" ) - if [ $(date -d $unstable_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then - result=$stable_download_url - else - result=$unstable_url - fi - fi - - echo $result + if [ $(date -d $unstable_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=$unstable_url + fi + fi + + echo $result } get_boot_cfg() { @@ -119,7 +119,7 @@ get_next_boot_deployment() { local TO_BOOT='this-is-not-a-valid-version-string' if [ -f "${boot_cfg_path}" ] && grep "^title" "${boot_cfg_path}" > /dev/null; then TO_BOOT=`grep ^title ${boot_cfg_path} | sed 's/title //'` - fi + fi echo ${TO_BOOT} } From ce7967708c8fe7b1501a2cc3a3800dec8065bbcf Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 12:18:51 +0200 Subject: [PATCH 12/18] fixup test --- test/run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run.sh b/test/run.sh index fbbfcea..09b756d 100755 --- a/test/run.sh +++ b/test/run.sh @@ -29,7 +29,7 @@ check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat echo echo '==== testing channel' -check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' +check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' From a71c08e14d07554cff57f5337c628933443fdd56 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 13:45:40 +0200 Subject: [PATCH 13/18] handle null return if channels do not exist --- __frzr-deploy | 58 ++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index a0a90b5..f381857 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -41,46 +41,52 @@ get_img_url() { result=$stable_download_url elif [ "$CHANNEL" == "testing" ]; then # Testing channel have prerelease = true and no other tags - testing_release_date=$(echo "${result}" | jq -r '[ .[] | + if testing_release_date=$(echo "${result}" | jq -er '[ .[] | select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ] | first | .published_at' - ) - testing_url=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==true) | - select(.name|test("\\[.*\\]")|not) ] | - first | - .assets[] | - select(.browser_download_url | test("img")) | - .browser_download_url' - ) - if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then - result=$stable_download_url + ); then + testing_url=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==true) | + select(.name|test("\\[.*\\]")|not) ] | + first | + .assets[] | + select(.browser_download_url | test("img")) | + .browser_download_url' + ) + if [ $(date -d $testing_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=$testing_url + fi else - result=$testing_url + result=$stable_download_url fi else # Match any release with CHANNEL as a tag (including unstable) result=$(echo ${result} | jq "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ]") - unstable_release_date=$(echo "${result}" | jq -r "[ .[] | + if unstable_release_date=$(echo "${result}" | jq -er "[ .[] | select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | first | .published_at" - ) - unstable_url=$(echo "${result}" | jq -r "[ .[] | - select(.prerelease==true) | - select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | - first | - .assets[] | - select(.browser_download_url | test(\"img\")) | - .browser_download_url" - ) - if [ $(date -d $unstable_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then - result=$stable_download_url + ); then + unstable_url=$(echo "${result}" | jq -r "[ .[] | + select(.prerelease==true) | + select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | + first | + .assets[] | + select(.browser_download_url | test(\"img\")) | + .browser_download_url" + ) + if [ $(date -d $unstable_release_date +%s) -le $(date -d $stable_release_date +%s) ]; then + result=$stable_download_url + else + result=$unstable_url + fi else - result=$unstable_url + result=$stable_download_url fi fi From 6713e64238847109b05c4dd241c9ac73ec97fd93 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 13:46:18 +0200 Subject: [PATCH 14/18] add NULL tests --- test/run.sh | 2 ++ test/test5.dat | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 test/test5.dat diff --git a/test/run.sh b/test/run.sh index 09b756d..1b473d4 100755 --- a/test/run.sh +++ b/test/run.sh @@ -32,12 +32,14 @@ echo '==== testing channel' check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' +check 'should return stable when no testing asset exists' $(cat test5.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' echo echo '==== unstable channel' check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' check 'should prioritize stable asset over older unstable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' +check 'should return stable when no unstable asset exists' $(cat test5.dat | get_img_url unstable) 'chimeraos-1_0000000.img.tar.xz' echo echo '==== direct' diff --git a/test/test5.dat b/test/test5.dat new file mode 100644 index 0000000..a011143 --- /dev/null +++ b/test/test5.dat @@ -0,0 +1,25 @@ +[ + { + "tag_name": "1_0000000", + "name": "ChimeraOS 1", + "prerelease": false, + "published_at": "2022-05-05T03:31:40Z", + "assets": [ + { + "name": "build_info.txt", + "state": "uploaded", + "browser_download_url": "build_info.txt" + }, + { + "name": "chimeraos-1_0000000.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-1_0000000.img.tar.xz" + }, + { + "name": "sha256sum.txt", + "state": "uploaded", + "browser_download_url": "sha256sum.txt" + } + ] + } +] From df9b5015fd60e79e62b2e0e043af4d81d5f62d11 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 18:01:59 +0200 Subject: [PATCH 15/18] make sure assets are done uploading --- __frzr-deploy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/__frzr-deploy b/__frzr-deploy index f381857..988ed34 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -9,6 +9,9 @@ get_img_url() { # Order by creation date in reverse result=$(jq 'sort_by(.published_at) | reverse') + # Remove entries which have not been completed uploading + result=$(echo "${result}" | jq 'del(.[] | select(.assets[].state != "uploaded"))') + # Always check for stable date stable_release_date=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==false) ] | From 6873db5d7a8601c3e57c0e41ea2ef6a7fb5577d3 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Sun, 1 Oct 2023 18:04:35 +0200 Subject: [PATCH 16/18] published_at -> created_at --- __frzr-deploy | 8 ++++---- test/test1.dat | 6 +++--- test/test2.dat | 8 ++++---- test/test3a.dat | 4 ++-- test/test3b.dat | 4 ++-- test/test3c.dat | 4 ++-- test/test4.dat | 6 +++--- test/test4a.dat | 6 +++--- test/test4b.dat | 6 +++--- test/test5.dat | 2 +- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/__frzr-deploy b/__frzr-deploy index 988ed34..2ac00e1 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -7,7 +7,7 @@ get_img_url() { CHANNEL=$1 # Order by creation date in reverse - result=$(jq 'sort_by(.published_at) | reverse') + result=$(jq 'sort_by(.created_at) | reverse') # Remove entries which have not been completed uploading result=$(echo "${result}" | jq 'del(.[] | select(.assets[].state != "uploaded"))') @@ -16,7 +16,7 @@ get_img_url() { stable_release_date=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==false) ] | first | - .published_at' + .created_at' ) # Check for stable url, this is the latest that have prerelease == false stable_download_url=$(echo "${result}" | jq -r '[ .[] | @@ -48,7 +48,7 @@ get_img_url() { select(.prerelease==true) | select(.name|test("\\[.*\\]")|not) ] | first | - .published_at' + .created_at' ); then testing_url=$(echo "${result}" | jq -r '[ .[] | select(.prerelease==true) | @@ -73,7 +73,7 @@ get_img_url() { select(.prerelease==true) | select(.name|test(\"\\\[${CHANNEL}\\\]\" ; \"i\")) ] | first | - .published_at" + .created_at" ); then unstable_url=$(echo "${result}" | jq -r "[ .[] | select(.prerelease==true) | diff --git a/test/test1.dat b/test/test1.dat index 797f329..9d999a0 100644 --- a/test/test1.dat +++ b/test/test1.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000000", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2022-05-05T03:31:40Z", + "created_at": "2022-05-05T03:31:40Z", "assets": [ { "name": "build_info.txt", @@ -26,7 +26,7 @@ "tag_name": "2_0000000", "name": "ChimeraOS 2 (0000000)", "prerelease": true, - "published_at": "2022-05-07T03:31:40Z", + "created_at": "2022-05-07T03:31:40Z", "assets": [ { "name": "build_info.txt", @@ -49,7 +49,7 @@ "tag_name": "3_0000000", "name": "ChimeraOS 3 (0000000) [UNSTABLE]", "prerelease": true, - "published_at": "2022-05-08T03:31:40Z", + "created_at": "2022-05-08T03:31:40Z", "assets": [ { "name": "build_info.txt", diff --git a/test/test2.dat b/test/test2.dat index 9ec7481..ccb6ec1 100644 --- a/test/test2.dat +++ b/test/test2.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001) [UNSTABLE]", "prerelease": true, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": true, - "published_at": "2022-01-02T00:00:00Z", + "created_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "1_0000003", "name": "ChimeraOS 1 (0000003)", "prerelease": false, - "published_at": "2023-01-01T00:00:00Z", + "created_at": "2023-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000003.img.tar.xz", @@ -42,7 +42,7 @@ "tag_name": "1_0000004", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2024-01-01T00:00:00Z", + "created_at": "2024-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000004.img.tar.xz", diff --git a/test/test3a.dat b/test/test3a.dat index ee4380c..383f283 100644 --- a/test/test3a.dat +++ b/test/test3a.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": false, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": false, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test3b.dat b/test/test3b.dat index 6696e8a..1619f76 100644 --- a/test/test3b.dat +++ b/test/test3b.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": true, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": true, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test3c.dat b/test/test3c.dat index 2ca3376..7e2994b 100644 --- a/test/test3c.dat +++ b/test/test3c.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001) [UNSTABLE]", "prerelease": true, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002) [UNSTABLE]", "prerelease": true, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", diff --git a/test/test4.dat b/test/test4.dat index 82fe90a..51deabe 100644 --- a/test/test4.dat +++ b/test/test4.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1-1_0000011", "name": "ChimeraOS 1-1", "prerelease": false, - "published_at": "2021-01-01T10:00:00Z", + "created_at": "2021-01-01T10:00:00Z", "assets": [ { "name": "chimeraos-1-1_0000011.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "2_0000002", "name": "ChimeraOS 2", "prerelease": false, - "published_at": "2022-01-02T00:00:00Z", + "created_at": "2022-01-02T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", diff --git a/test/test4a.dat b/test/test4a.dat index fa80168..013687b 100644 --- a/test/test4a.dat +++ b/test/test4a.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "2_0000002", "name": "ChimeraOS 2", "prerelease": false, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", diff --git a/test/test4b.dat b/test/test4b.dat index fc23a68..19b2463 100644 --- a/test/test4b.dat +++ b/test/test4b.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000002", "name": "ChimeraOS 1 (0000002)", "prerelease": false, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000002.img.tar.xz", @@ -16,7 +16,7 @@ "tag_name": "1_0000001", "name": "ChimeraOS 1 (0000001)", "prerelease": false, - "published_at": "2021-01-01T00:00:00Z", + "created_at": "2021-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -29,7 +29,7 @@ "tag_name": "2_0000002", "name": "ChimeraOS 2 (0000002)", "prerelease": false, - "published_at": "2022-01-01T00:00:00Z", + "created_at": "2022-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-2_0000002.img.tar.xz", diff --git a/test/test5.dat b/test/test5.dat index a011143..3776d38 100644 --- a/test/test5.dat +++ b/test/test5.dat @@ -3,7 +3,7 @@ "tag_name": "1_0000000", "name": "ChimeraOS 1", "prerelease": false, - "published_at": "2022-05-05T03:31:40Z", + "created_at": "2022-05-05T03:31:40Z", "assets": [ { "name": "build_info.txt", From 80edec4745c2da2847df55d1e10c382811060044 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Mon, 2 Oct 2023 11:39:35 +0200 Subject: [PATCH 17/18] re-enabled uploaded tests, also add logic and test to handle non existing stable channels --- __frzr-deploy | 32 +++++++++++++++++++------------- test/run.sh | 30 ++++++++++++++++++------------ test/test3b.dat | 27 ++++++++++++++++++++------- test/test3c.dat | 29 +++++++++++++++++++++-------- test/test6.dat | 28 ++++++++++++++++++++++++++++ 5 files changed, 106 insertions(+), 40 deletions(-) create mode 100644 test/test6.dat diff --git a/__frzr-deploy b/__frzr-deploy index 2ac00e1..4570e02 100644 --- a/__frzr-deploy +++ b/__frzr-deploy @@ -13,19 +13,25 @@ get_img_url() { result=$(echo "${result}" | jq 'del(.[] | select(.assets[].state != "uploaded"))') # Always check for stable date - stable_release_date=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==false) ] | - first | - .created_at' - ) - # Check for stable url, this is the latest that have prerelease == false - stable_download_url=$(echo "${result}" | jq -r '[ .[] | - select(.prerelease==false) ] | - first | - .assets[] | - select(.browser_download_url | test("img")) | - .browser_download_url' - ) + if stable_release_date=$(echo "${result}" | jq -er '[ .[] | + select(.prerelease==false) ] | + first | + .created_at' + ); then + # Check for stable url, this is the latest that have prerelease == false + stable_download_url=$(echo "${result}" | jq -r '[ .[] | + select(.prerelease==false) ] | + first | + .assets[] | + select(.browser_download_url | test("img")) | + .browser_download_url' + ) + else + # No stable channel found, pick some (old) values + # For testing/ channel selection + stable_release_date="1970-01-01T00:00:00Z" + stable_download_url="" + fi # Filter channels by release naming conventions diff --git a/test/run.sh b/test/run.sh index 1b473d4..9c1601d 100755 --- a/test/run.sh +++ b/test/run.sh @@ -22,24 +22,30 @@ check() { echo echo '== get_img_url' echo '==== stable channel' -check 'should select the system image asset in stable' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' -check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over newer testing asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' +check 'should select the system image asset in stable' $(cat test1.dat | get_img_url stable) 'chimeraos-1_0000000.img.tar.xz' +check 'should prioritize latest stable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over newer testing asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url stable) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize uploaded stable asset over not-uploaded' $(cat test3a.dat | get_img_url stable) 'chimeraos-1_0000001.img.tar.xz' +check 'should handle non existing stable channel' $(cat test6.dat | get_img_url stable) '' echo echo '==== testing channel' -check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' -check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' -check 'should return stable when no testing asset exists' $(cat test5.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' +check 'should select the system image asset in testing' $(cat test1.dat | get_img_url testing) 'chimeraos-2_0000000.img.tar.xz' +check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over newer unstable asset' $(cat test2.dat | get_img_url testing) 'chimeraos-1_0000004.img.tar.xz' +check 'should return stable when no testing asset exists' $(cat test5.dat | get_img_url testing) 'chimeraos-1_0000000.img.tar.xz' +check 'should prioritize uploaded testing asset over not-uploaded' $(cat test3b.dat | get_img_url testing) 'chimeraos-2_0000001.img.tar.xz' +check 'should handle non existing stable channel' $(cat test6.dat | get_img_url testing) 'chimeraos-1_0000001.img.tar.xz' echo echo '==== unstable channel' -check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' -check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' -check 'should prioritize stable asset over older unstable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' -check 'should return stable when no unstable asset exists' $(cat test5.dat | get_img_url unstable) 'chimeraos-1_0000000.img.tar.xz' +check 'should select the system image asset in unstable' $(cat test1.dat | get_img_url unstable) 'chimeraos-3_0000000.img.tar.xz' +check 'should prioritize stable asset over older testing asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' +check 'should prioritize stable asset over older unstable asset' $(cat test2.dat | get_img_url unstable) 'chimeraos-1_0000004.img.tar.xz' +check 'should return stable when no unstable asset exists' $(cat test5.dat | get_img_url unstable) 'chimeraos-1_0000000.img.tar.xz' +check 'should prioritize uploaded unstable asset over not-uploaded' $(cat test3c.dat | get_img_url unstable) 'chimeraos-2_0000001.img.tar.xz' +check 'should handle non existing stable channel' $(cat test6.dat | get_img_url unstable) 'chimeraos-2_0000001.img.tar.xz' echo echo '==== direct' diff --git a/test/test3b.dat b/test/test3b.dat index 1619f76..52402d0 100644 --- a/test/test3b.dat +++ b/test/test3b.dat @@ -1,9 +1,9 @@ [ { - "tag_name": "1_0000001", + "tag_name": "1_0000000", "name": "ChimeraOS 1 (0000001)", - "prerelease": true, - "created_at": "2021-01-01T00:00:00Z", + "prerelease": false, + "created_at": "2020-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -13,15 +13,28 @@ ] }, { - "tag_name": "1_0000002", - "name": "ChimeraOS 1 (0000002)", + "tag_name": "2_0000001", + "name": "ChimeraOS 2 (0000001)", + "prerelease": true, + "created_at": "2021-01-01T00:00:00Z", + "assets": [ + { + "name": "chimeraos-2_0000001.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-2_0000001.img.tar.xz" + } + ] + }, + { + "tag_name": "2_0000002", + "name": "ChimeraOS 2 (0000002)", "prerelease": true, "created_at": "2022-01-01T00:00:00Z", "assets": [ { - "name": "chimeraos-1_0000002.img.tar.xz", + "name": "chimeraos-2_0000002.img.tar.xz", "state": "not-uploaded", - "browser_download_url": "chimeraos-1_0000002.img.tar.xz" + "browser_download_url": "chimeraos-2_0000002.img.tar.xz" } ] } diff --git a/test/test3c.dat b/test/test3c.dat index 7e2994b..f2edea3 100644 --- a/test/test3c.dat +++ b/test/test3c.dat @@ -1,9 +1,9 @@ [ { - "tag_name": "1_0000001", - "name": "ChimeraOS 1 (0000001) [UNSTABLE]", - "prerelease": true, - "created_at": "2021-01-01T00:00:00Z", + "tag_name": "1_0000000", + "name": "ChimeraOS 1 (0000001)", + "prerelease": false, + "created_at": "2020-01-01T00:00:00Z", "assets": [ { "name": "chimeraos-1_0000001.img.tar.xz", @@ -13,15 +13,28 @@ ] }, { - "tag_name": "1_0000002", - "name": "ChimeraOS 1 (0000002) [UNSTABLE]", + "tag_name": "2_0000001", + "name": "ChimeraOS 2 (0000001) [UNSTABLE]", + "prerelease": true, + "created_at": "2021-01-01T00:00:00Z", + "assets": [ + { + "name": "chimeraos-2_0000001.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-2_0000001.img.tar.xz" + } + ] + }, + { + "tag_name": "2_0000002", + "name": "ChimeraOS 2 (0000002) [UNSTABLE]", "prerelease": true, "created_at": "2022-01-01T00:00:00Z", "assets": [ { - "name": "chimeraos-1_0000002.img.tar.xz", + "name": "chimeraos-2_0000002.img.tar.xz", "state": "not-uploaded", - "browser_download_url": "chimeraos-1_0000002.img.tar.xz" + "browser_download_url": "chimeraos-2_0000002.img.tar.xz" } ] } diff --git a/test/test6.dat b/test/test6.dat new file mode 100644 index 0000000..06fa0a3 --- /dev/null +++ b/test/test6.dat @@ -0,0 +1,28 @@ +[ + { + "tag_name": "1_0000001", + "name": "ChimeraOS 1 (0000001)", + "prerelease": true, + "created_at": "2021-01-01T00:00:00Z", + "assets": [ + { + "name": "chimeraos-1_0000001.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-1_0000001.img.tar.xz" + } + ] + }, + { + "tag_name": "2_0000002", + "name": "ChimeraOS 2 (0000002) [UNSTABLE]", + "prerelease": true, + "created_at": "2022-01-01T00:00:00Z", + "assets": [ + { + "name": "chimeraos-2_0000001.img.tar.xz", + "state": "uploaded", + "browser_download_url": "chimeraos-2_0000001.img.tar.xz" + } + ] + } +] From 913b7a89afccd11b607f3764a445df251540d847 Mon Sep 17 00:00:00 2001 From: bouhaa Date: Mon, 2 Oct 2023 11:47:21 +0200 Subject: [PATCH 18/18] make alignment not burn my eyes --- test/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/run.sh b/test/run.sh index 9c1601d..7d30f75 100755 --- a/test/run.sh +++ b/test/run.sh @@ -49,10 +49,10 @@ check 'should handle non existing stable channel' $(cat test6. echo echo '==== direct' -check 'should select newest version by default' $(cat test4.dat | get_img_url stable) 'chimeraos-2_0000002.img.tar.xz' -check 'should be able to select older versions' $(cat test4.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' -check 'should be able to select older point versions' $(cat test4.dat | get_img_url 1-1) 'chimeraos-1-1_0000011.img.tar.xz' -check 'should select latest matching asset' $(cat test4a.dat | get_img_url 1) 'chimeraos-1_0000002.img.tar.xz' +check 'should select newest version by default' $(cat test4.dat | get_img_url stable) 'chimeraos-2_0000002.img.tar.xz' +check 'should be able to select older versions' $(cat test4.dat | get_img_url 1) 'chimeraos-1_0000001.img.tar.xz' +check 'should be able to select older point versions' $(cat test4.dat | get_img_url 1-1) 'chimeraos-1-1_0000011.img.tar.xz' +check 'should select latest matching asset' $(cat test4a.dat | get_img_url 1) 'chimeraos-1_0000002.img.tar.xz' echo echo '== get_boot_cfg'