commit:     86d3e174d2581952f280e073b474b2e2451ee72e
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Mar  2 19:10:52 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Mar  3 05:21:02 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86d3e174

app-eselect/eselect-wine: don't fail if migration file exists

May have been left there if other preinst commands failed
(like eselect wine unset --all which can be fickle).

Alternatively could cp -f, but best avoid clobbering more
files we don't own as much as possible. Guess a better
approach would've been to put it in ${T} and tell eselect
where to find it in postinst but at this point not going
to worry about due-to-be-removed cruft.

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

 app-eselect/eselect-wine/eselect-wine-2.0.2.ebuild | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app-eselect/eselect-wine/eselect-wine-2.0.2.ebuild 
b/app-eselect/eselect-wine/eselect-wine-2.0.2.ebuild
index 953f7e1c910d..dc64574f7852 100644
--- a/app-eselect/eselect-wine/eselect-wine-2.0.2.ebuild
+++ b/app-eselect/eselect-wine/eselect-wine-2.0.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -43,8 +43,10 @@ src_install() {
 pkg_preinst() {
        if has_version '<app-eselect/eselect-wine-2'; then
                # keep copy of still-set 'active' to auto-select same slots
-               [[ ! -e ${EROOT}/etc/eselect/wine/active ]] ||
+               if [[ -e ${EROOT}/etc/eselect/wine/active &&
+                       ! -e ${EROOT}/etc/eselect/wine/eselect-wine-migration 
]]; then
                        cp 
"${EROOT}"/etc/eselect/wine/{active,eselect-wine-migration} || die
+               fi
 
                # managed differently, need cleanup
                eselect wine unset --all || die

Reply via email to