delete old package from repo, on upgrade

This commit is contained in:
LinuxSquare 2024-04-20 20:43:04 +02:00
parent 2d8e14d2f8
commit 467542e3a1

View file

@ -205,6 +205,7 @@ function build_pkgs() {
container_run "sudo apk update && sudo apk upgrade && cd /build/$pkg && abuild checksum && abuild -r && find /home/apkbuild/packages/build -name $1*.apk -exec mv {} /build/$1 \;"
message_blue_single_arrow "Copying package to repo"
local VERSION_ID=$(container_run "grep VERSION_ID= /etc/os-release")
find $REPO_DIR/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64 -name $1*.apk -exec rm -f {} \;
rsync -a --delete-before --progress "${BUILD_DIR}/$pkg"/*.apk "${REPO_DIR}/v$(echo $VERSION_ID | cut -d= -f2 | rev | cut -d. -f2- | rev)/noveria/x86_64"
rm -f "${BUILD_DIR}/$pkg"/*.apk
refresh_repo