From 2da50b4172e03d8c76ee288f7705c9590d88e461 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 1 Mar 2024 17:33:06 +0100 Subject: [PATCH] Drop repository for unsupported Releases --- tools/repository/repo | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tools/repository/repo b/tools/repository/repo index 6ba7d5127..7d78ffa29 100755 --- a/tools/repository/repo +++ b/tools/repository/repo @@ -1,5 +1,30 @@ #!/usr/bin/env bash +# Drop Unsupported Releases +# +drop_unsupported_releases() { + + BUILD_FW=($(grep -rw config/distributions/*/support -ve 'eos' | cut -d"/" -f3)) + REPO=($(aptly publish list -config="${CONFIG}" --raw | sed "s/. //g")) + + DROP=() + for i in "${REPO[@]}"; do + skip= + for j in "${BUILD_FW[@]}"; do + [[ $i == $j ]] && { skip=1; break ; } + done + [[ -n $skip ]] || DROP+=("$i") + done + + # drop + for i in "${DROP[@]}"; do + aptly publish drop -config="${CONFIG}" "${i}" + done +} + + + + # Adding package # # @arg $1 string component @@ -259,6 +284,8 @@ case $3 in ;; update) + # remove old releases from publishing + drop_unsupported_releases publishing "$1" "$2" "$3" "$4" "$5" ;;