commit:     276d8e75a1710808645c4b130e6c3b80ed4968c0
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 16 16:57:35 2025 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Sun Feb 16 17:27:15 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=276d8e75

app-emulation/wine-*: verify eselect-wine availability in postrm

The package manager spec does not guarantee that IDEPEND will be
available in pre/postrm.

If missing, then it means there is nothing to do and eselect-wine
already cleaned the last wine version ahead of wine removal.

This could notably happen if a user emerge -C eselect-wine then
attempts to remove wine which would result in a postrm failure given
the package manager won't reinstall it during removal.

This used to be a real problem when wine used "pre"rm given `die`
would abort removal and you're left with an unremovable package,
but for a long time now wine migrated to "post"rm so this was at
most just a minor annoyance.

We can keep `|| die` for the actual call, it's good to strongly
appeal that it failed despite being in a situation where it should
have worked and, as noted, that won't block actual removal.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 app-emulation/wine-proton/wine-proton-8.0.5c.ebuild  | 4 +++-
 app-emulation/wine-proton/wine-proton-9.0.2.ebuild   | 4 +++-
 app-emulation/wine-proton/wine-proton-9.0.4.ebuild   | 4 +++-
 app-emulation/wine-proton/wine-proton-9999.ebuild    | 4 +++-
 app-emulation/wine-staging/wine-staging-10.0.ebuild  | 4 +++-
 app-emulation/wine-staging/wine-staging-10.1.ebuild  | 4 +++-
 app-emulation/wine-staging/wine-staging-9.0.ebuild   | 4 +++-
 app-emulation/wine-staging/wine-staging-9999.ebuild  | 4 +++-
 app-emulation/wine-vanilla/wine-vanilla-10.0.ebuild  | 4 +++-
 app-emulation/wine-vanilla/wine-vanilla-10.1.ebuild  | 4 +++-
 app-emulation/wine-vanilla/wine-vanilla-8.0.2.ebuild | 4 +++-
 app-emulation/wine-vanilla/wine-vanilla-9.0.ebuild   | 4 +++-
 app-emulation/wine-vanilla/wine-vanilla-9999.ebuild  | 4 +++-
 13 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/app-emulation/wine-proton/wine-proton-8.0.5c.ebuild 
b/app-emulation/wine-proton/wine-proton-8.0.5c.ebuild
index c5e848376068..369241a19cb1 100644
--- a/app-emulation/wine-proton/wine-proton-8.0.5c.ebuild
+++ b/app-emulation/wine-proton/wine-proton-8.0.5c.ebuild
@@ -413,5 +413,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-proton/wine-proton-9.0.2.ebuild 
b/app-emulation/wine-proton/wine-proton-9.0.2.ebuild
index 4315a6ab2158..2314a5a096c4 100644
--- a/app-emulation/wine-proton/wine-proton-9.0.2.ebuild
+++ b/app-emulation/wine-proton/wine-proton-9.0.2.ebuild
@@ -445,5 +445,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-proton/wine-proton-9.0.4.ebuild 
b/app-emulation/wine-proton/wine-proton-9.0.4.ebuild
index 3b56b56302d6..62681918df8f 100644
--- a/app-emulation/wine-proton/wine-proton-9.0.4.ebuild
+++ b/app-emulation/wine-proton/wine-proton-9.0.4.ebuild
@@ -445,5 +445,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-proton/wine-proton-9999.ebuild 
b/app-emulation/wine-proton/wine-proton-9999.ebuild
index 64c99557d831..fd9e2d49e34b 100644
--- a/app-emulation/wine-proton/wine-proton-9999.ebuild
+++ b/app-emulation/wine-proton/wine-proton-9999.ebuild
@@ -448,5 +448,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-staging/wine-staging-10.0.ebuild 
b/app-emulation/wine-staging/wine-staging-10.0.ebuild
index 517e06a88c97..b9f6cba67acd 100644
--- a/app-emulation/wine-staging/wine-staging-10.0.ebuild
+++ b/app-emulation/wine-staging/wine-staging-10.0.ebuild
@@ -479,5 +479,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-staging/wine-staging-10.1.ebuild 
b/app-emulation/wine-staging/wine-staging-10.1.ebuild
index 517e06a88c97..b9f6cba67acd 100644
--- a/app-emulation/wine-staging/wine-staging-10.1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-10.1.ebuild
@@ -479,5 +479,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-staging/wine-staging-9.0.ebuild 
b/app-emulation/wine-staging/wine-staging-9.0.ebuild
index fc7dfd731bbc..7b9acc98ab06 100644
--- a/app-emulation/wine-staging/wine-staging-9.0.ebuild
+++ b/app-emulation/wine-staging/wine-staging-9.0.ebuild
@@ -488,5 +488,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-staging/wine-staging-9999.ebuild 
b/app-emulation/wine-staging/wine-staging-9999.ebuild
index a759ced54cf4..91bb4e3675cd 100644
--- a/app-emulation/wine-staging/wine-staging-9999.ebuild
+++ b/app-emulation/wine-staging/wine-staging-9999.ebuild
@@ -461,5 +461,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-vanilla/wine-vanilla-10.0.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-10.0.ebuild
index d912312e42aa..ff3c7bd622bf 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-10.0.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-10.0.ebuild
@@ -442,5 +442,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-vanilla/wine-vanilla-10.1.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-10.1.ebuild
index 0a51b2565e22..93fb715508b9 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-10.1.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-10.1.ebuild
@@ -442,5 +442,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-vanilla/wine-vanilla-8.0.2.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-8.0.2.ebuild
index 1a8afb08db8d..32f4e9b03470 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-8.0.2.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-8.0.2.ebuild
@@ -397,5 +397,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-vanilla/wine-vanilla-9.0.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-9.0.ebuild
index 300262a71242..05db199543ff 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-9.0.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-9.0.ebuild
@@ -436,5 +436,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

diff --git a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
index 88708ce71147..e69ea3ce3b1e 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
@@ -424,5 +424,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       eselect wine update --if-unset || die
+       if has_version -b app-eselect/eselect-wine; then
+               eselect wine update --if-unset || die
+       fi
 }

Reply via email to