From 2b9c818d8db30389c366746e60efa665c0d591cc Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 10 Sep 2024 17:56:44 +0200 Subject: [PATCH] pkgbase: fix decision logic to keep the old packages when running update-package, we try to keep as much as possible the old packages to avoid wasting users bandwidth. the previous code was failing at catching properly the "snap" extension and we lost incremental build. With this new code we only stop checking we we have an old package with the same checksum if we transition from: - alpha to beta - beta to rc - rc to release but we keep old packages when we transition from release to p1 or when we stay on a given snapshot PR: 281393 Reported by: Evgenii Khramtsov --- Makefile.inc1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index ec1db75234b..57141a48243 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2038,7 +2038,7 @@ PKG_EXT= pkg .if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} -BRANCH_EXT_FROM= ${PKG_VERSION_FROM:C/.*([[:alpha:]][^\.]*).*/\1/} +BRANCH_EXT_FROM= ${PKG_VERSION_FROM:C/^[^[:alpha:]]+p?([[:alpha:]]*)[0-9]+$/\1/} .else PKG_VERSION_FROM= PKG_VERSION_FROM_DIR= @@ -2079,7 +2079,7 @@ real-update-packages: stage-packages .PHONY continue; \ fi ; \ newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \ - if [ "${BRANCH_EXT_FROM}" == "${BRANCH_EXT}" -a "$${oldsum}" == "$${newsum}" ]; then \ + if [ "${BRANCH_EXT_FROM}" == "${BRANCH_EXT:C/[0-9]+$//}" -a "$${oldsum}" == "$${newsum}" ]; then \ echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \ rm ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ; \ cp $${pkg} ${REPODIR}/${PKG_ABI}/${PKG_VERSION} ; \