From owner-dev-commits-src-all@freebsd.org Thu Jan 21 03:58:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6297D4E7C72; Thu, 21 Jan 2021 03:58:40 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DLpXc1s4Mz4pQX; Thu, 21 Jan 2021 03:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 28481254A5; Thu, 21 Jan 2021 03:58:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10L3weGn048955; Thu, 21 Jan 2021 03:58:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10L3weTH048954; Thu, 21 Jan 2021 03:58:40 GMT (envelope-from git) Date: Thu, 21 Jan 2021 03:58:40 GMT Message-Id: <202101210358.10L3weTH048954@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 26490d9b74f0 - main - pkgbase: allow update-packages for first-run of packaging MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26490d9b74f0bdefbb9df74dcd285ecd08e0a961 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 03:58:40 -0000 The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=26490d9b74f0bdefbb9df74dcd285ecd08e0a961 commit 26490d9b74f0bdefbb9df74dcd285ecd08e0a961 Author: Kyle Evans AuthorDate: 2021-01-18 20:11:58 +0000 Commit: Kyle Evans CommitDate: 2021-01-21 03:58:30 +0000 pkgbase: allow update-packages for first-run of packaging If ${REPODIR}/${PKG_ABI} does not exist when we begin real-update-packages, skip the comparison with the non-existent previous repository and just finish the repo off. This allows external scripts to just assume they can run `update-packages` rather than figuring out if they'd previously run `packages` for this Version/Arch combo. PKG_VERSION_FROM_DIR was added so that we could perhaps detect the three distinct cases: 1.) If the repo has not yet been created, PKG_VERSION_FROM_DIR will be empty. 2.) If the repo is in some intermediate state between created and fully initialized, PKG_VERSION_FROM_DIR may point to the ABI directory. 3.) If the repo is fully initialized, then PKG_VERSION_FROM_DIR points to the latest build to compare to. Option #2 is explicitly unhandled at the moment, but this is no different than it was before. Reviewed-by: manu Differential-Revision: https://reviews.freebsd.org/D28229 --- Makefile.inc1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 969e3d67cd05..d9ef01eefde5 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1876,7 +1876,13 @@ PKG_ABI!=${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI .if !defined(PKG_VERSION_FROM) && make(real-update-packages) .if defined(PKG_ABI) +.if exists(${REPODIR}/${PKG_ABI}) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest +PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} +.else +PKG_VERSION_FROM= +PKG_VERSION_FROM_DIR= +.endif .endif .endif @@ -1900,8 +1906,11 @@ real-packages: stage-packages create-packages sign-packages .PHONY real-update-packages: stage-packages .PHONY ${_+_}${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} create-packages +.if empty(PKG_VERSION_FROM_DIR) + @echo "==> Bootstrapping repository, not checking for new packages" +.else @echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})" - @for pkg in ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM}/${PKG_NAME_PREFIX}-*; do \ + @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \ pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \ newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_FORMAT} ; \ oldsum=$$(pkg query -F $${pkg} '%X') ; \ @@ -1917,6 +1926,7 @@ real-update-packages: stage-packages .PHONY echo "==> New package $${newpkgname}" ; \ fi ; \ done +.endif ${_+_}@cd ${.CURDIR}; \ ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} sign-packages