From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 63DA41581C1 for ; Thu, 11 Jul 2024 16:30:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 47B80E2A2C; Thu, 11 Jul 2024 16:30:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 268DAE2A2C for ; Thu, 11 Jul 2024 16:30:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 12FA7341256 for ; Thu, 11 Jul 2024 16:30:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 72F7C1E1A for ; Thu, 11 Jul 2024 16:29:59 +0000 (UTC) From: "Eli Schwartz" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Eli Schwartz" Message-ID: <1720715309.424908701d9854699393101d9a732cfd6a450ef7.eschwartz@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-emulation/libvirt/libvirt-10.0.0-r3.ebuild app-emulation/libvirt/libvirt-10.1.0-r2.ebuild app-emulation/libvirt/libvirt-10.2.0-r1.ebuild app-emulation/libvirt/libvirt-10.3.0-r2.ebuild app-emulation/libvirt/libvirt-10.5.0.ebuild app-emulation/libvirt/libvirt-9999.ebuild X-VCS-Directories: app-emulation/libvirt/ X-VCS-Committer: eschwartz X-VCS-Committer-Name: Eli Schwartz X-VCS-Revision: 424908701d9854699393101d9a732cfd6a450ef7 X-VCS-Branch: master Date: Thu, 11 Jul 2024 16:29:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d734a632-fb73-4cff-80b6-f13072aafed4 X-Archives-Hash: 2b896f730ed0dbe0a6c436d8ede9b045 commit: 424908701d9854699393101d9a732cfd6a450ef7 Author: Eli Schwartz gentoo org> AuthorDate: Thu Jul 11 15:14:42 2024 +0000 Commit: Eli Schwartz gentoo org> CommitDate: Thu Jul 11 16:28:29 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42490870 app-emulation/libvirt: implement a correct python_check_deps Due to portage design whereby commands which fail aren't considered failures unless you explicitly use `|| die`, a common footgun in bash scripting propagates throughout the portage ecosystem: the use of `cmd1 && cmd2` for conditional logic. This python_check_deps function did such, and then handled the case where `use test` was false by unconditionally ignoring the result of the previous line by returning 0. Hence, python_check_deps could never decide that an impl was unable to be used. As a result, if python 3.13 and 3.12 were both installed, but $(python_gen_any_dep ...) discovered pytest installed solely for 3.12, portage would not reinstall pytest for 3.13 support whereas the eclass would select 3.13 as the preferred (latest) python impl. Fix this by correctly using bash, shunning `cmd1 && cmd2`, and instead using `if cmd1; then cmd2; fi`, which returns correct return values based on the return value of both cmd1 and cmd2, without requiring hardcoded `return 0`s of any variety, unconditional or otherwise. Fixes: bba723505f488b52bd593869b5b9a0df096ffbb4 Bug: https://bugs.gentoo.org/932652 Closes: https://bugs.gentoo.org/935849 Signed-off-by: Eli Schwartz gentoo.org> app-emulation/libvirt/libvirt-10.0.0-r3.ebuild | 5 +++-- app-emulation/libvirt/libvirt-10.1.0-r2.ebuild | 5 +++-- app-emulation/libvirt/libvirt-10.2.0-r1.ebuild | 5 +++-- app-emulation/libvirt/libvirt-10.3.0-r2.ebuild | 5 +++-- app-emulation/libvirt/libvirt-10.5.0.ebuild | 5 +++-- app-emulation/libvirt/libvirt-9999.ebuild | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app-emulation/libvirt/libvirt-10.0.0-r3.ebuild b/app-emulation/libvirt/libvirt-10.0.0-r3.ebuild index d32d4dfa61eb..e1f5b32c94f2 100644 --- a/app-emulation/libvirt/libvirt-10.0.0-r3.ebuild +++ b/app-emulation/libvirt/libvirt-10.0.0-r3.ebuild @@ -158,8 +158,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() { diff --git a/app-emulation/libvirt/libvirt-10.1.0-r2.ebuild b/app-emulation/libvirt/libvirt-10.1.0-r2.ebuild index 722c2a65d7e5..4b7123665d73 100644 --- a/app-emulation/libvirt/libvirt-10.1.0-r2.ebuild +++ b/app-emulation/libvirt/libvirt-10.1.0-r2.ebuild @@ -157,8 +157,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() { diff --git a/app-emulation/libvirt/libvirt-10.2.0-r1.ebuild b/app-emulation/libvirt/libvirt-10.2.0-r1.ebuild index 53b5807aa428..f888ab84e3c8 100644 --- a/app-emulation/libvirt/libvirt-10.2.0-r1.ebuild +++ b/app-emulation/libvirt/libvirt-10.2.0-r1.ebuild @@ -156,8 +156,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() { diff --git a/app-emulation/libvirt/libvirt-10.3.0-r2.ebuild b/app-emulation/libvirt/libvirt-10.3.0-r2.ebuild index 86977d70b34c..1bdfb61feab9 100644 --- a/app-emulation/libvirt/libvirt-10.3.0-r2.ebuild +++ b/app-emulation/libvirt/libvirt-10.3.0-r2.ebuild @@ -157,8 +157,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() { diff --git a/app-emulation/libvirt/libvirt-10.5.0.ebuild b/app-emulation/libvirt/libvirt-10.5.0.ebuild index 3c850fe537a4..6c1f35a42d3e 100644 --- a/app-emulation/libvirt/libvirt-10.5.0.ebuild +++ b/app-emulation/libvirt/libvirt-10.5.0.ebuild @@ -158,8 +158,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() { diff --git a/app-emulation/libvirt/libvirt-9999.ebuild b/app-emulation/libvirt/libvirt-9999.ebuild index 3c850fe537a4..6c1f35a42d3e 100644 --- a/app-emulation/libvirt/libvirt-9999.ebuild +++ b/app-emulation/libvirt/libvirt-9999.ebuild @@ -158,8 +158,9 @@ PATCHES=( ) python_check_deps() { - use test && python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" - return 0 + if use test; then + python_has_version -d "dev-python/pytest[${PYTHON_USEDEP}]" + fi } pkg_setup() {