diff --git a/tools/repository/repo b/tools/repository/repo index 6ba7d51276..7d78ffa293 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" ;;