From nobody Thu Oct 10 06:49:23 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XPL2q4BnXz5YVdt; Thu, 10 Oct 2024 06:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XPL2q3kSpz4V77; Thu, 10 Oct 2024 06:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728542963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOmrTB21NnWQ5dazv40eYvU059rV4gw2/kVcdw8pOTI=; b=TMRkMiu5Sonxoabo40d9JqMm75dqJZ/V7AUaaPF14UXTbioIaviSXXAXKRLJJyk4rPaSgX +NcvK3kO0jFsyTljZwpYxqjgwGwFGOSgFoKu97cQeF9rWXJBVd7wBR+0OEe6YWyRdhO4Hv B+7hrVcfdb/eziHcFsYHM30c8yxr8BOFmgwRTaLsStiteWXMNnIvRUlkE8LWlhgvLaCBmN 4su5+4bvtlrQu6stOa0ped1V00ECw7JepzK7Q3Yu7TdvEgOpROvR5qURIPH6+GkpEZyfAC U/zvs/Wl5+ggdfhyV3yiqMZwB+usq3qQ+Xf0M1c8q+XEMXoLv1SCoUxYLydcDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728542963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BOmrTB21NnWQ5dazv40eYvU059rV4gw2/kVcdw8pOTI=; b=Iy6NUuawP8f47h6jW6bRL5XGbIOjHqaZOXzE9Y6RzDG8i2MRXKVVZBFc+cKZhqpPWPHuqw ojNCFuCFdo46XXT9gYKxPZqOIKofXkXMlhVclppzUrbTLYxIKrjsI5ZpukoGZ7spnHnW0T l155DZXL400GSC/gs6W5IN2X/5kfJK+jmC22rCMEAxerZLVgWtYnwrKXmE62yR3cafvUfL XlsdFraDyFKpyOjUGWDfp60sSiSyND3LvWifaI7/OfAY4tQOQGVmlR08DL4yErvaEuCSYj uEPJfV0Ro064mtSK9WiXrujLYTGFD5gsbbh6Oxg6liTw9xD6i8Wb+Ca65z3EIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728542963; a=rsa-sha256; cv=none; b=blkoqEQeKe8ALZKZZtyBsqPNDm6/D+ESReKzMjme3Ahd43wcI7DyMR5gljIkhPIxgdXmlA MFgge7BN27lEMkZWBxgQyV9a1N/k1dv4Pr1qR5b3m4HD58rFudlHrdNd5fQ6FuUux+rUoQ KOz/GYgjGr+MPtey/cKHMTpr01z+axDey1Qo7PNClUdEE0SUEGqO4uecgvvUSA6JP27SjF CkjYs8QKK4sbGfpKIQGfeplPt9msxBBFb1RpE4pWPbrxf7RcHQ/0khDrZ88QVSt9RJLhvM p7J9lvARNLHcFRdN+2qKOyYD/9WZ5R0SxmJZ1pSI4gkI+Pt76EWFNJ7WFiVOlg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XPL2q3LtrznWG; Thu, 10 Oct 2024 06:49:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49A6nNkx008842; Thu, 10 Oct 2024 06:49:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49A6nNZk008839; Thu, 10 Oct 2024 06:49:23 GMT (envelope-from git) Date: Thu, 10 Oct 2024 06:49:23 GMT Message-Id: <202410100649.49A6nNZk008839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 458dc7f30310 - main - pkgbase: fix incremental generation of packages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 458dc7f30310394a571fd4f2f5368acd48684652 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=458dc7f30310394a571fd4f2f5368acd48684652 commit 458dc7f30310394a571fd4f2f5368acd48684652 Author: Baptiste Daroussin AuthorDate: 2024-10-08 06:53:45 +0000 Commit: Baptiste Daroussin CommitDate: 2024-10-10 06:48:28 +0000 pkgbase: fix incremental generation of packages Replace the regex trying to catch the branch name of the existing repository which was too naive with simpler glob matching. As a result the only case when we only use the new packages are: moving from alpha to beta moving from beta to rc moving from rc to release changing the major version number for the main git branch PR: 281393 Differential Revision: D46874 --- Makefile.inc1 | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 557bbc825625..55d49d5760f2 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -571,28 +571,27 @@ VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDA .endif MAJOR_REVISION= ${_REVISION:R} -.if !defined(PKG_VERSION) _PKG_REVISION= ${_REVISION} _STRTIMENOW= %Y%m%d%H%M%S _TIMENOW= ${_STRTIMENOW:gmtime} BRANCH_EXT= .if ${_BRANCH:MCURRENT*} || ${_BRANCH:MSTABLE*} || ${_BRANCH:MPRERELEASE*} -_PKG_REVISION= ${MAJOR_REVISION} -BRANCH_EXT= snap -EXTRA_REVISION= .${BRANCH_EXT}${_TIMENOW} +_PKG_REVISION:= ${MAJOR_REVISION} +BRANCH_EXT= ${MAJOR_REVISION}.snap +EXTRA_REVISION= .snap${_TIMENOW} .elif ${_BRANCH:MALPHA*} -BRANCH_EXT= a${_BRANCH:C/ALPHA([0-9]+).*/\1/} -EXTRA_REVISION= .${BRANCH_EXT}.${_TIMENOW} +BRANCH_EXT= alpha +EXTRA_REVISION= .${_BRANCH:C/ALPHA([0-9]+).*/\1/}.${_TIMENOW} .elif ${_BRANCH:MBETA*} -BRANCH_EXT= b${_BRANCH:C/BETA([0-9]+).*/\1/} -EXTRA_REVISION= .${BRANCH_EXT}.${_TIMENOW} +BRANCH_EXT= beta +EXTRA_REVISION= .${_BRANCH:C/BETA([0-9]+).*/\1/}.${_TIMENOW} .elif ${_BRANCH:MRC*} -BRANCH_EXT= rc${_BRANCH:C/RC([0-9]+).*/\1/} -EXTRA_REVISION= .${BRANCH_EXT}.${_TIMENOW} +BRANCH_EXT= rc +EXTRA_REVISION= .rc${_BRANCH:C/RC([0-9]+).*/\1/}.${_TIMENOW} .elif ${_BRANCH:M*-p*} -BRANCH_EXT= p${_BRANCH:C/.*-p([0-9]+$)/\1/} -EXTRA_REVISION= ${BRANCH_EXT} +EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/} .endif +.if !defined(PKG_VERSION) PKG_VERSION:= ${_PKG_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif .endif # !defined(PKG_VERSION) @@ -2040,7 +2039,26 @@ 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:]]+p?([[:alpha:]]*)[0-9]+$/\1/} +# Determine the name of the branch base on the version +# X.bY => beta +# X.aY => alpha +# X.rcY => rc +# X.snap => snap +# all others mean release +# +# This will be used when comparing to the branch that we are building +# to decide if we keep old packages or new packages when only their +# version differs +BRANCH_EXT_FROM= +.if ${PKG_VERSION_FROM:M*.snap*} +BRANCH_EXT_FROM= ${PKG_VERSION_FROM:C/.snap.*$//}.snap +.elif ${PKG_VERSION_FROM:M*.b*} +BRANCH_EXT_FROM= beta +.elif ${PKG_VERSION_FROM:M*.rc*} +BRANCH_EXT_FROM= rc +.elif ${PKG_VERSION_FROM:M*.a*} +BRANCH_EXT_FROM= alpha +.endif .else PKG_VERSION_FROM= PKG_VERSION_FROM_DIR= @@ -2081,7 +2099,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:C/[0-9]+$//}" -a "$${oldsum}" == "$${newsum}" ]; then \ + if [ "${BRANCH_EXT_FROM}" = "${BRANCH_EXT}" -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} ; \