From ae469d650329ac623234999c0cb3b3b2fabcb351 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Thu, 9 May 2024 16:29:31 +0200 Subject: [PATCH] Change the way repository is getting updated --- tools/repository/repo | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/repository/repo b/tools/repository/repo index df1549315..6795b4185 100755 --- a/tools/repository/repo +++ b/tools/repository/repo @@ -83,22 +83,31 @@ aptly repo add -force-replace=true -config="${CONFIG}" "${1}" "${tmp_dir}/${fake # $5: jammy,sid # publishing() { + # read comma delimited distros into array IFS=', ' read -r -a DISTROS <<< "$5" local errors=0 # publish all, update selected -local distributions=($(grep -rw config/distributions/*/support -ve 'eos' | cut -d"/" -f3)) -#local distributions=("jessy" "xenial" "stretch" "bionic" "focal" "hirsute" "impish" "jammy" "lunar" "kinetic" "buster" "bullseye" "bookworm" "sid") +local distributions=($(grep -rw config/distributions/*/support -ve '' | cut -d"/" -f3)) for release in "${distributions[@]}"; do + local forceoverwrite="" ADDING_PACKAGES="false" # shellcheck disable=SC2207,2199 if [[ " ${DISTROS[@]} " =~ " ${release} " ]] ; then - echo "Adding: ${release}" ADDING_PACKAGES="true" fi + # don't add packages to eos + if [[ ${status} == $(cat config/distributions/${release}/support) ]]; then + ADDING_PACKAGES="false" + fi + + if [[ ${ADDING_PACKAGES} == true ]]; then + echo "Adding: ${release}" + fi + # let's drop from publish if exits if [[ -n $(aptly publish list -config="${CONFIG}" -raw | awk '{print $(NF)}' | grep "${release}") ]]; then aptly publish drop -config="${CONFIG}" "${release}" > /dev/null 2>&1