nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 27 lines 917 B view raw
1fixupOutputHooks+=('if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi') 2 3compressManPages() { 4 local dir="$1" 5 6 if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ] 7 then return 8 fi 9 echo "gzipping man pages under $dir/share/man/" 10 11 # Compress all uncompressed manpages. Don't follow symlinks, etc. 12 # gzip -f is needed to not error out on hard links. 13 find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \ 14 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -f 15 16 # Point symlinks to compressed manpages. 17 find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \ 18 | sort -z \ 19 | while IFS= read -r -d $'\0' f 20 do 21 local target 22 target="$(readlink -f "$f")" 23 if [ -f "$target".gz ]; then 24 ln -sf "$target".gz "$f".gz && rm "$f" 25 fi 26 done 27}