From nobody Sun Apr 24 11:43:08 2022 X-Original-To: dev-commits-ports-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 783FC1A8DB03; Sun, 24 Apr 2022 11:43:08 +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 4KmR982y8Fz4dMJ; Sun, 24 Apr 2022 11:43:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650800588; 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=xn6jR0Tu/Zo6TNQ9Yo00icHT+pKDmZdAfaW3iSp27zM=; b=hgOcLB1IEkBGPKPQuRv8mXMRMSflbQy2L8KPraQaxcQVP1WJcOY5gLvQuwOlLpz0GbKoMJ Qt93b+Y8lcWiApQ0j8tR3GxfnE8EGRHcMG2ZFEcIV1FrkYlI8OrEmo6/FLNptOqkhLzfi8 Z8eJ3huRxrLFgmPeDhjH5WLos8RFFBRBeKkkNBuE+RMMAIoINqmm6U0spXO3oJPmX32uxA e8C+AAxKddExdsqboMFu0wdVDg/oT16NkVNEbYxXAzlZSjgdUAGUlEs3FgogyAXCz+wo7I KPjvUECcyI/Fl5Mb5V96hQMAoUgsGboaNbizw7O1JN8/JreGMYCo1hiMd8R3IQ== 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 4524325B07; Sun, 24 Apr 2022 11:43:08 +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 23OBh8RE074413; Sun, 24 Apr 2022 11:43:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23OBh8Ch074412; Sun, 24 Apr 2022 11:43:08 GMT (envelope-from git) Date: Sun, 24 Apr 2022 11:43:08 GMT Message-Id: <202204241143.23OBh8Ch074412@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: d21825d73a9c - main - Mk/bsd.port.mk: simplify conflicts checks logic List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d21825d73a9c3421e28a7bf6fcf1b342bb692315 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650800588; 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=xn6jR0Tu/Zo6TNQ9Yo00icHT+pKDmZdAfaW3iSp27zM=; b=eB1sscl2AmQ81wQpTaNWrqUKhxDgPHgDn6b1UCwBjNP4X6zGUB5teqt36R/zuNtZba126/ gXO24ctfxYfEN7mVHj5dwwxgm4pKW6Kz27ZTlBYiOnXqU400u0GUkGyzJDGio3CjFKXV6c tIw3Bvoyz37doKUuInkhm94FfBSk3cL4P+Po1hES2XzZSRfwLOq/8ZXSSh6GiYaSJX/S5R /IEBcs/DpconQs6cwdEWpVMgX6mvAwIupJ0FbUQnQwWJ6t3kLvzwDk4PoWKtt9OIE/549G lqx+/1yK0q1x3NIvmexzOcosNvSra4+Nz0q/bx2j9vEgc8auprNF7wQ+H59zbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650800588; a=rsa-sha256; cv=none; b=SWe/KNMlAGmZEW5fTF6MceVTGyiUu0dnz1pfcDC0vELeA0cUQEDh0ZjOrH86bPO64ZrsI7 0YdY73EYLbupTGcU23vh6bGHkqmzgcXDWayc80AfqrIPg5TOqPQ8NOGCtNGjO5zX3k8vEd vmFHMuoYE3ECcNkJoF3CXt/1nw7SGUcieZQP5eE4AQprfgfUuJTR5QiHYka0WYLdh5xWaM ukNR6bDjkQqe1kLywNwDoGj83E3E17v1s+gxD8eTQdaAP9XEF/KG/CP7haS1KT3rJQKetr AihlbHdJsvH3MF8wW7dstQNeSROkaBaHxdR7Fs3HkF7zgEzstV0HMPJujiX1Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by se: URL: https://cgit.FreeBSD.org/ports/commit/?id=d21825d73a9c3421e28a7bf6fcf1b342bb692315 commit d21825d73a9c3421e28a7bf6fcf1b342bb692315 Author: Stefan Eßer AuthorDate: 2022-04-24 11:40:03 +0000 Commit: Stefan Eßer CommitDate: 2022-04-24 11:40:03 +0000 Mk/bsd.port.mk: simplify conflicts checks logic I had added support for the specification of a condition and package name patterns to Version 1.17.2 of the pkg command. This change allows to simplify the conflicts checks: instead of listing all packages that match a name pattern and then apply a filter to select the relevant values, the filter condition is now passed to the pkg command. This update includes a change to the semantics of the conflicts check which aligns the output with current package naming practices: After the introduction of flavors a "same origin exclusion" was introduced, which removed packages from the conflicts list when they shared the same origin (without considering the flavor). This was required to allow the installation of e.g. python modules for different interpreter versions (which typically use interpreter version specific sub-directories to store their files), at a time when there was no strict requirement to have non-colliding package base names. The "same origin exclusion" is wrong for ports with conflicting flavors, e.g. devel/git where only one flavor may be installed at any time - but the conflict is ignored due to the same origin of all the different git packages. Since all packages are now required to have a distinct base name (e.g. by using a prefix like "py38-" instead of the prior "py-"), a "same package base name exclusion" can be used to make the conflicts check stricter and to correctly report the conflict if for example some git flavor is installed and the installation of another one is attempted. An update of the documentation of the CONFLICTS* variables that describes the "same package base name exclusion" has been committed to the porter's handbook. The Makefiles of many flavored ports could be simplified as described in review D31303 (https://reviews.freebsd.org/D31303), since the complexity of those definitions results from the exclusion of the currently built package base name from the CONFLICTS definition, which was unneeded before (due to the "same origin exclusion", which made all these CONFLICTS definitions void, anyway) and is now correctly dealt with after this commit (due to the "same package base name exclusion"). This patch has been first put up for review in October of 2021, with a comment that it should not be applied before pkg-1.17.2 (or newer) can be assumed to be generally used. Bapt@ accepted the change but later requested the MINIMAL_PKG_VERSION to be adjusted to require pkg-1.17.2 (as included in this commit). Due to recent white-space changes in bsd.port.mk the latest patch uploaded for review does no longer cleanly apply. This commit contains an updated version that matches the white-space changes (indentation of .if / .else / .endif and other elements). [This change had previously been applied as commit e03f85dbc9c, but during a last minute white space adjustment 1 line had been lost. This commit applies the change as has been accepted in the review, updated to match the recent white-space changes.] Approved by: portmgr (bapt) Differential Revision: https://reviews.freebsd.org/D32694 --- Mk/bsd.port.mk | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index f1e258672484..e060d8fbf747 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1047,7 +1047,7 @@ _FLAVOR:= ${FLAVOR} .if !defined(PORTS_FEATURES) && empty(${PORTS_FEATURES:MFLAVORS}) PORTS_FEATURES+= FLAVORS .endif -MINIMAL_PKG_VERSION= 1.15.9 +MINIMAL_PKG_VERSION= 1.17.2 _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \ ${STAGEDIR}${PREFIX} ${WRKDIR}/pkg ${BINARY_LINKDIR} @@ -3294,13 +3294,7 @@ check-conflicts: check-build-conflicts check-install-conflicts . if !target(check-build-conflicts) check-build-conflicts: . if ( defined(CONFLICTS) || defined(CONFLICTS_BUILD) ) && !defined(DISABLE_CONFLICTS) && !defined(DEFER_CONFLICTS_CHECK) - @conflicts_with=$$( \ - { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; } \ - | while read pkgname prfx orgn; do \ - if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \ - ${ECHO_CMD} -n " $${pkgname}"; \ - fi; \ - done); \ + @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} 2>/dev/null || : ; ) ; \ if [ -n "$${conflicts_with}" ]; then \ ${ECHO_MSG}; \ ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ @@ -3319,13 +3313,7 @@ check-build-conflicts: CONFLICT_WARNING_WAIT?= 10 identify-install-conflicts: . if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) ) && !defined(DISABLE_CONFLICTS) - @conflicts_with=$$( \ - { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \ - | while read pkgname prfx orgn; do \ - if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \ - ${ECHO_CMD} -n " $${pkgname}"; \ - fi; \ - done); \ + @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \ if [ -n "$${conflicts_with}" ]; then \ ${ECHO_MSG}; \ ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ @@ -3344,13 +3332,7 @@ identify-install-conflicts: check-install-conflicts: . if ( defined(CONFLICTS) || defined(CONFLICTS_INSTALL) || ( defined(CONFLICTS_BUILD) && defined(DEFER_CONFLICTS_CHECK) ) ) && !defined(DISABLE_CONFLICTS) . if defined(DEFER_CONFLICTS_CHECK) - @conflicts_with=$$( \ - { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \ - | while read pkgname prfx orgn; do \ - if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \ - ${ECHO_CMD} -n " $${pkgname}"; \ - fi; \ - done); \ + @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_BUILD:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \ if [ -n "$${conflicts_with}" ]; then \ ${ECHO_MSG}; \ ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \ @@ -3362,13 +3344,7 @@ check-install-conflicts: exit 1; \ fi . else - @conflicts_with=$$( \ - { ${PKG_QUERY} -g "%n-%v %p %o" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; } \ - | while read pkgname prfx orgn; do \ - if [ "/${PREFIX}" = "/$${prfx}" -a "/${PKGORIGIN}" != "/$${orgn}" ]; then \ - ${ECHO_CMD} -n " $${pkgname}"; \ - fi; \ - done); \ + @conflicts_with=$$(${PKG_QUERY} -ge "%n != ${PKGBASE}" "%n-%v" ${CONFLICTS:C/.+/'&'/} ${CONFLICTS_INSTALL:C/.+/'&'/} 2>/dev/null || : ; ) ; \ if [ -n "$${conflicts_with}" ]; then \ ${ECHO_MSG}; \ ${ECHO_MSG} "===> ${PKGNAME} conflicts with installed package(s): "; \