Change the way repository is getting updated

This commit is contained in:
Igor Pecovnik 2024-05-09 16:29:31 +02:00 committed by Igor
parent 649569eccd
commit ae469d6503
1 changed files with 12 additions and 3 deletions

View File

@ -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