From nobody Mon Feb 06 21:15:10 2023 X-Original-To: dev-commits-src-all@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 4P9fDH255yz3nRDb; Mon, 6 Feb 2023 21:15:11 +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 4P9fDH1cJVz44D5; Mon, 6 Feb 2023 21:15:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675718111; 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=9b4RrWH1+nhGy4evtWEUZ4CAOhy11yTp53Td1AXI6OU=; b=IsJ3muTlyx1A1sMoTmy+hn4h0tmzEkij+xUt60SK6K7ajSQr9xeduRWGPBX1hMfLwLze0K p1Ekb63UHxCQUbfBIYvxtGJ1SvV6Zz1Z7RhXdzVUyMQScq7jcVOpOr+0VnI4Z6R50q0FtH jAnGPgleLCDXoTdsZH264zWew2w5x17D/syjS29fm7NiIIdqtEqE4iKc3bemn2+JZfeqIc fxJXYsSXKIlViYOAmk2ydIKFC0sGyKuzbRtkOIrf4slwkS5EySnDY/JBS9QTme/VX+uf5d fObSR+09hIu2HCeN/qJoJq//wcc32gnP8ka2pN28NLTuZ0IjT9s6UXRr+hdd7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675718111; 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=9b4RrWH1+nhGy4evtWEUZ4CAOhy11yTp53Td1AXI6OU=; b=BwKVsI/Rhg1tDiVWoNqc5lqOe2OLh/CrsUkoYCKmUqC7AHShMLjYok8hZLexO4jL15vKi7 J9n5loD/kAf6xst8ONAEYy4FfuErQpah+j/3VS/MXHaksBnJvZyWXGCc6jooYzWMVyrt2y LDS8VDjeX8nS2RgyRGv1O92ldR2sypLuFn6CXpcY9Gw3TZFoQ8K3gPC0ltcGYcnyR/6ebB 2K3QxKzWWUrY0oMU4i4mIv7FNyGrhmIYfZ2Iw1VyQA/mMQvKFJ+IZrxc1fM92l2TuIYfTT V6iMHm0nj6OFcVCSMFJRRTtCjY1Fm/7daxVOwgGbPy5kBs2sljGuTctpbYeJqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675718111; a=rsa-sha256; cv=none; b=qzwWvNQrjH/kTOCc4DGo4r6M3fmt+nfK+EtGXbt3DoxwpNtlgVyT63iqb5v750BC6uzz42 /FlqE7wRCrbeLfRYXlpPo1ZVKJfFzxJ67FB9QQmq2Ds/qbvV2REnwUSrwXMucf22HcCpbn 9mnNVSB6ehkE1cThZoq6ZVJtKZ9WDD3TJLNx4067vBW4UWL3ie7V7T6JgtVzVyAZKThYwk Z2iUrqetdusosevvXXMvxIiZ4MnHq9HlfIZBHGA4JlhC90Exw3L7JytDmz40tWhlk7P6Ew Ks9yo07y5zWWotfkkMKvksUFrGJBTwwnwVJQ4eeax5wDBwUez20XTCGTubghMQ== 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 4P9fDH0fp7zq2n; Mon, 6 Feb 2023 21:15:11 +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 316LFAfa064180; Mon, 6 Feb 2023 21:15:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 316LFAK8064179; Mon, 6 Feb 2023 21:15:10 GMT (envelope-from git) Date: Mon, 6 Feb 2023 21:15:10 GMT Message-Id: <202302062115.316LFAK8064179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a1e3fb8fa0a4 - main - Fix _REVISION to be always major.minor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a1e3fb8fa0a4652bc345bd284c32d6630a8dbe08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a1e3fb8fa0a4652bc345bd284c32d6630a8dbe08 commit a1e3fb8fa0a4652bc345bd284c32d6630a8dbe08 Author: Eugene M. Kim AuthorDate: 2022-03-11 04:32:00 +0000 Commit: Warner Losh CommitDate: 2023-02-06 21:02:32 +0000 Fix _REVISION to be always major.minor Introduced in commit 613fe53, _REVISION was redefined to be just the major version (14) instead of major.minor (14.0) iff: - PKG_VERSION was not overridden (default), and - Branch was -CURRENT, -STABLE, or -PRERELEASE. This introduced side effects in other parts of the code which expected _REVISION to be major.minor: - make-pkg-package.sh target triple became amd64-portbld-freebsd14 (should be amd64-portbld-freebsd14.0); - Versioned cross dev symlink name became amd64-freebsd14- (should be amd64-freebsd14.0-) Also, compounded with commit ea9a92d (which was introduced afterward and removed minor version from _REVISION incorrectly using :S with a regex) this also caused pkgbase repo to use a wrong PKG_ABI with a minor version (FreeBSD:14.0:amd64) when a custom PKG_VERSION was specified. (Note, without a custom PKG_VERSION the bug was not triggered because in that case _REVISION was already major-only.) This commit fixes both problems by introducing and using MAJOR_REVISION instead of redefining _REVISION. Existing uses of _REVISION now see major.minor again, except PKG_ABI (ex: FreeBSD:14:amd64, as described above) and PKG_VERSION (ex: 14.snap20220311121531) need only the major version and now use MAJOR_REVISION instead. PR: 262600, 262601 Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/592 --- Makefile.inc1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 7c82c2bfa763..d18a9795e7bf 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -536,12 +536,12 @@ SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ VERSION= FreeBSD ${_REVISION}-${_BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE} .export VERSION .endif +MAJOR_REVISION= ${_REVISION:R} .if !defined(PKG_VERSION) _STRTIMENOW= %Y%m%d%H%M%S _TIMENOW= ${_STRTIMENOW:gmtime} .if ${_BRANCH:MCURRENT*} || ${_BRANCH:MSTABLE*} || ${_BRANCH:MPRERELEASE*} -_REVISION:= ${_REVISION:R} EXTRA_REVISION= .snap${_TIMENOW} .elif ${_BRANCH:MALPHA*} EXTRA_REVISION= .a${_BRANCH:C/ALPHA([0-9]+).*/\1/}.${_TIMENOW} @@ -552,7 +552,7 @@ EXTRA_REVISION= .rc${_BRANCH:C/RC([0-9]+).*/\1/}.${_TIMENOW} .elif ${_BRANCH:M*-p*} EXTRA_REVISION= p${_BRANCH:C/.*-p([0-9]+$)/\1/} .endif -PKG_VERSION:= ${_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} +PKG_VERSION:= ${MAJOR_REVISION}${EXTRA_REVISION:C/[[:space:]]//g} .endif .endif # !defined(PKG_VERSION) @@ -1901,7 +1901,7 @@ _pkgbootstrap: .PHONY # Determine PKG_ABI from newvers.sh if not already set. # .if !defined(PKG_ABI) && (make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) || make(sign-packages)) -PKG_ABI=${_TYPE}:${_REVISION:S/\..*$//}:${TARGET_ARCH} +PKG_ABI=${_TYPE}:${MAJOR_REVISION}:${TARGET_ARCH} .endif PKG_BIN_VERSION!=${PKG_CMD} --version /dev/null |\ awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}'