commit: 5c3b042d3a4a17760338b9eac5c09efc569620ee
parent de81257d5cfd063c13c2d2e74050252e4dbb2e79
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 6 Dec 2024 04:07:39 +0100
bashrc: Fix makewhatis
Diffstat:
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/bashrc b/bashrc
@@ -1,9 +1,5 @@
#!/bin/bash
-if [ "${EBUILD_PHASE}" == "postinst" ] || [ "${EBUILD_PHASE}" == "postrm" ]; then
- echo ":: Calling makewhatis"
- makewhatis -Q -T utf8 ${MANPATH//:/ }
-fi
# Will be ran before configure phase, allowing ebuild to delete blobs themselves in the prepare phase
post_src_prepare() {
@@ -22,3 +18,18 @@ post_src_prepare() {
fi
}
+# should also do post_pkg_postrm but inst ought to be enough
+post_pkg_postinst() {
+ echo ":: Calling makewhatis"
+ (
+ # Somehow otherwise MANPATH isn't set
+ . /etc/profile
+
+ makewhatis -Q -T utf8
+
+ for db in ${MANPATH//://mandoc.db }/mandoc.db
+ do
+ test -f "$db" && chmod +r "$db"
+ done
+ )
+}