The branch main has been updated by bapt:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2b9c818d8db30389c366746e60efa665c0d591cc

commit 2b9c818d8db30389c366746e60efa665c0d591cc
Author:     Baptiste Daroussin <b...@freebsd.org>
AuthorDate: 2024-09-10 15:56:44 +0000
Commit:     Baptiste Daroussin <b...@freebsd.org>
CommitDate: 2024-09-10 16:05:29 +0000

    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 <throwaway_vthg...@protonmail.com>
---
 Makefile.inc1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index ec1db75234b2..57141a482433 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} ; \

Reply via email to