From a1e97134e0cc9f1c58ce2c6b4423a9bffff86b0e Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 21 Jan 2023 22:30:13 +0100 Subject: [PATCH] Remove badges stuff, now handled by tartiflette --- maintenance/update_badges.sh | 59 ------------------------------------ results/badges/get_badges.sh | 13 -------- 2 files changed, 72 deletions(-) delete mode 100755 maintenance/update_badges.sh delete mode 100755 results/badges/get_badges.sh diff --git a/maintenance/update_badges.sh b/maintenance/update_badges.sh deleted file mode 100755 index f7b9fb2..0000000 --- a/maintenance/update_badges.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -#================================================= -# Grab the script directory -#================================================= - -if [ "${0:0:1}" == "/" ]; then script_dir="$(dirname "$0")"; else script_dir="$(echo $PWD/$(dirname "$0" | cut -d '.' -f2) | sed 's@/$@@')"; fi - -#================================================= -# Get the list and check for any modifications -#================================================= - -# Get the apps list from app.yunohost.org -wget -nv https://app.yunohost.org/default/v3/apps.json -O "$script_dir/apps.json" - -do_update=1 -if [ -e "$script_dir/apps.json.md5" ] -then - if md5sum --check --status "$script_dir/apps.json.md5" - then - echo "No changes into the app list since the last execution." - do_update=0 - fi -fi - -if [ $do_update -eq 1 ] -then - md5sum "$script_dir/apps.json" > "$script_dir/apps.json.md5" - - #================================================= - # Update badges for all apps - #================================================= - - # Parse each app into the list - while read app - do - # Get the status for this app - state=$(jq --raw-output ".apps[\"$app\"] | .state" "$script_dir/apps.json") - level=$(jq --raw-output ".apps[\"$app\"] | .level" "$script_dir/apps.json") - if [[ "$state" == "working" ]] - then - if [[ "$level" == "null" ]] || [[ "$level" == "?" ]] - then - state="just-got-added-to-catalog" - elif [[ "$level" == "0" ]] || [[ "$level" == "-1" ]] - then - state="broken" - fi - fi - - # Get the maintained status for this app - maintained=$(jq --raw-output ".apps[\"$app\"] | .antifeatures | .[]" "$script_dir/apps.json" | grep -q 'package-not-maintained' && echo unmaintained || echo maintained) - - cp "$script_dir/../badges/$state.svg" "$script_dir/../badges/${app}.status.svg" - cp "$script_dir/../badges/$maintained.svg" "$script_dir/../badges/${app}.maintain.svg" - - # List all apps from the list, by getting manifest ID. - done <<< "$(jq --raw-output ".apps[] | .manifest.id" "$script_dir/apps.json")" -fi diff --git a/results/badges/get_badges.sh b/results/badges/get_badges.sh deleted file mode 100755 index 650c338..0000000 --- a/results/badges/get_badges.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# Get the path of this script -script_dir="$(dirname "$(realpath "$0")")" - -wget -q https://upload.wikimedia.org/wikipedia/commons/1/1d/No_image.svg -O "$script_dir/maintained.svg" -wget -q https://img.shields.io/badge/Status-Package%20not%20maintained-red.svg -O "$script_dir/unmaintained.svg" - -wget -q https://img.shields.io/badge/Status-working-brightgreen.svg -O "$script_dir/working.svg" -wget -q https://img.shields.io/badge/Status-Just%20got%20added%20to%20catalog-yellowgreen.svg -O "$script_dir/just-got-added-to-catalog.svg" -wget -q https://img.shields.io/badge/Status-In%20progress-orange.svg -O "$script_dir/inprogress.svg" -wget -q https://img.shields.io/badge/Status-Not%20working-red.svg -O "$script_dir/notworking.svg" -wget -q https://img.shields.io/badge/Status-Broken-red.svg -O "$script_dir/broken.svg"