void-packages/common/hooks/post-install/00-uncompress-manpages.sh
Piotr Wójcik 27d9e7ffea hooks/uncompress-manpages: prevent hang
In case when file to be uncompressed existed, decompressors asked
whether to overwrite it.
As output is muted, building hung silently waiting for input.
2019-01-05 08:12:55 -02:00

22 lines
513 B
Bash

# 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 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
}