1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-14 10:58:05 +01:00
void-packages/common/hooks/post-install/00-uncompress-manpages.sh

21 lines
516 B
Bash
Raw Normal View History

2024-03-29 08:12:19 +01:00
# This hook uncompresses man(1) files.
hook() {
local f lnkat mandir=${PKGDESTDIR}/usr/share/man
if [ ! -d $mandir ] ||
[ -z "$(find $mandir -regex '.*\.\(gz\|bz2\)' -print -quit)" ]; then
return 0
fi
# rewrite symlinks
find $mandir -type l -regex '.*\.\(gz\|bz2\)' | while read -r f; do
lnkat=$(readlink "$f")
ln -s ${lnkat%.*} ${f%.*}
rm $f
done
find $mandir -type f -name '*.gz' -exec gunzip -v -f {} + &>/dev/null
find $mandir -type f -name '*.bz2' -exec bunzip2 -v -f {} + &>/dev/null
}