x11-misc/xkeyboard-config: fix collision workaround for binpkgs

Was hoping to "do nothing at all" when not needed, but cannot test
the current system in src_install for binpkgs. fwiw, we can still
avoid touching ${EROOT} for nothing unless xkb is a directory
(still with -f in case users did anything weird with permissions).

Also revbump just in case binpkgs were made already either with or
without the previous version of the workaround.

Closes: https://bugs.gentoo.org/957712
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2025-06-10 02:47:29 -04:00
parent fcdd74038d
commit cea0e7e937
2 changed files with 8 additions and 10 deletions

View File

@@ -69,14 +69,13 @@ src_install() {
meson_src_install
# Workaround for portage's collision checks, see pkg_preinst (bug #957712)
if has_version "<${CATEGORY}/${PN}-2.45"; then
mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
fi
mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
}
pkg_preinst() {
if [[ -L ${ED}/usr/share/X11/xkb.workaround ]]; then
# Avoid touching EROOT if not needed, and use -f just-in-case anyway
if [[ -d ${EROOT}/usr/share/X11/xkb ]]; then
rm -rf "${EROOT}"/usr/share/X11/xkb || die
mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
fi
mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
}

View File

@@ -69,14 +69,13 @@ src_install() {
meson_src_install
# Workaround for portage's collision checks, see pkg_preinst (bug #957712)
if has_version "<${CATEGORY}/${PN}-2.45"; then
mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
fi
mv "${ED}"/usr/share/X11/xkb{,.workaround} || die
}
pkg_preinst() {
if [[ -L ${ED}/usr/share/X11/xkb.workaround ]]; then
# Avoid touching EROOT if not needed, and use -f just-in-case anyway
if [[ -d ${EROOT}/usr/share/X11/xkb ]]; then
rm -rf "${EROOT}"/usr/share/X11/xkb || die
mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
fi
mv "${ED}"/usr/share/X11/xkb{.workaround,} || die
}