summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@gentoo.org>2024-07-11 11:14:42 -0400
committerEli Schwartz <eschwartz@gentoo.org>2024-07-11 12:28:29 -0400
commit424908701d9854699393101d9a732cfd6a450ef7 (patch)
tree7c01d8de77c14f8893133183c28aaaeeec6d0b80 /app-emulation
parentdev-build/meson: skip another test that inexplicably fails (diff)
downloadgentoo-424908701d9854699393101d9a732cfd6a450ef7.tar.gz
gentoo-424908701d9854699393101d9a732cfd6a450ef7.tar.bz2
gentoo-424908701d9854699393101d9a732cfd6a450ef7.zip
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 <eschwartz@gentoo.org>
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/libvirt/libvirt-10.0.0-r3.ebuild5
-rw-r--r--app-emulation/libvirt/libvirt-10.1.0-r2.ebuild5
-rw-r--r--app-emulation/libvirt/libvirt-10.2.0-r1.ebuild5
-rw-r--r--app-emulation/libvirt/libvirt-10.3.0-r2.ebuild5
-rw-r--r--app-emulation/libvirt/libvirt-10.5.0.ebuild5
-rw-r--r--app-emulation/libvirt/libvirt-9999.ebuild5
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() {