commit:     d8924b16afe3668e70dea2aac86e24f3f616d1a5
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 24 00:03:45 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 24 10:24:18 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8924b16

sys-auth/elogind: ewarn about hooks in obsolete path

Bug: https://bugs.gentoo.org/939216
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 sys-auth/elogind/elogind-255.5-r1.ebuild | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sys-auth/elogind/elogind-255.5-r1.ebuild 
b/sys-auth/elogind/elogind-255.5-r1.ebuild
index 22ad55a76fc2..2081a0952b41 100644
--- a/sys-auth/elogind/elogind-255.5-r1.ebuild
+++ b/sys-auth/elogind/elogind-255.5-r1.ebuild
@@ -172,6 +172,22 @@ pkg_postinst() {
                        elog "configuration remember to migrate those to new 
configuration file."
                fi
        done
+
+       local file files
+       # find custom hooks excluding known (nvidia-drivers, sys-power/tlp)
+       if [[ -d "${EROOT}"/$(get_libdir)/elogind/system-sleep ]]; then
+               readarray -t files < <(find 
"${EROOT}"/$(get_libdir)/elogind/system-sleep/ \
+                       -type f \( -not -iname ".keep_dir" -a \
+                               -not -iname "nvidia" -a \
+                               -not -iname "49-tlp-sleep" \) || die)
+       fi
+       if [[ ${#files[@]} -gt 0 ]]; then
+               ewarn "*** Custom hooks in obsolete path detected ***"
+               for file in "${files[@]}"; do
+                       ewarn "    ${file}"
+               done
+               ewarn "Move these custom hooks to 
${EROOT}/etc/elogind/system-sleep/ instead."
+       fi
 }
 
 pkg_postrm() {

Reply via email to