kde-plasma/plasma-meta: Don't force session manager, add pkg_postinst
authorAndreas Sturmlechner <asturm@gentoo.org>
Sat, 1 Dec 2018 09:40:06 +0000 (10:40 +0100)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sat, 1 Dec 2018 13:59:23 +0000 (14:59 +0100)
1) We don't have to, profiles and deps will do that anyway. Makes QA happy.
2) The informational pkg_postinst is more helpful as it will detect conflicting
session managers after install if they contradict plasma-meta USE settings.

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
kde-plasma/plasma-meta/plasma-meta-5.14.3-r1.ebuild
kde-plasma/plasma-meta/plasma-meta-5.14.4.ebuild

index a64a211a7053f92ebb5f18d77a51bff3a9b899f4..4d68b770cf6e50ad8204abe1cc00356a351d6950 100644 (file)
@@ -14,7 +14,7 @@ KEYWORDS="~amd64 ~arm ~x86"
 IUSE="bluetooth +browser-integration consolekit crypt +display-manager elogind grub gtk +handbook
 +legacy-systray networkmanager pam plymouth +pm-utils pulseaudio +sddm sdk systemd +wallpapers"
 
-REQUIRED_USE="^^ ( consolekit elogind systemd )"
+REQUIRED_USE="?? ( consolekit elogind systemd )"
 
 RDEPEND="
        $(add_plasma_dep breeze)
@@ -85,3 +85,24 @@ RDEPEND="
        sdk? ( $(add_plasma_dep plasma-sdk) )
        wallpapers? ( $(add_plasma_dep plasma-workspace-wallpapers) )
 "
+
+pkg_postinst() {
+       local i selected use_pkg_map=(
+               consolekit:sys-auth/consolekit
+               elogind:sys-auth/elogind
+               systemd:sys-apps/systemd
+       )
+       for i in ${use_pkg_map[@]}; do
+               use ${i%:*} && selected="${i%:*}"
+       done
+       for i in ${use_pkg_map[@]}; do
+               if ! use ${i%:*} && has_version ${i#*:}; then
+                       ewarn "An existing installation of ${i#*:} was detected even though"
+                       ewarn "${PN} was configured with USE ${selected} instead of ${i%:*}."
+                       ewarn "There can only be one session manager at runtime, otherwise random issues"
+                       ewarn "may occur. Please make sure USE ${i%:*} is nowhere enabled in make.conf"
+                       ewarn "or package.use and remove ${i#*:} before raising bugs."
+                       ewarn "For more information, visit https://wiki.gentoo.org/wiki/KDE"
+               fi
+       done
+}
index a64a211a7053f92ebb5f18d77a51bff3a9b899f4..4d68b770cf6e50ad8204abe1cc00356a351d6950 100644 (file)
@@ -14,7 +14,7 @@ KEYWORDS="~amd64 ~arm ~x86"
 IUSE="bluetooth +browser-integration consolekit crypt +display-manager elogind grub gtk +handbook
 +legacy-systray networkmanager pam plymouth +pm-utils pulseaudio +sddm sdk systemd +wallpapers"
 
-REQUIRED_USE="^^ ( consolekit elogind systemd )"
+REQUIRED_USE="?? ( consolekit elogind systemd )"
 
 RDEPEND="
        $(add_plasma_dep breeze)
@@ -85,3 +85,24 @@ RDEPEND="
        sdk? ( $(add_plasma_dep plasma-sdk) )
        wallpapers? ( $(add_plasma_dep plasma-workspace-wallpapers) )
 "
+
+pkg_postinst() {
+       local i selected use_pkg_map=(
+               consolekit:sys-auth/consolekit
+               elogind:sys-auth/elogind
+               systemd:sys-apps/systemd
+       )
+       for i in ${use_pkg_map[@]}; do
+               use ${i%:*} && selected="${i%:*}"
+       done
+       for i in ${use_pkg_map[@]}; do
+               if ! use ${i%:*} && has_version ${i#*:}; then
+                       ewarn "An existing installation of ${i#*:} was detected even though"
+                       ewarn "${PN} was configured with USE ${selected} instead of ${i%:*}."
+                       ewarn "There can only be one session manager at runtime, otherwise random issues"
+                       ewarn "may occur. Please make sure USE ${i%:*} is nowhere enabled in make.conf"
+                       ewarn "or package.use and remove ${i#*:} before raising bugs."
+                       ewarn "For more information, visit https://wiki.gentoo.org/wiki/KDE"
+               fi
+       done
+}