mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 10:56:53 +00:00
2def8e7499
Just use bash arrays directly. I.e. addHook preConfigure myPreConfigure is now preConfigureHooks+=(myPreConfigure)
28 lines
670 B
Bash
28 lines
670 B
Bash
fixupOutputHooks+=('if [ -z "$dontGzipMan" ]; then compressManPages "$prefix"; fi')
|
|
|
|
compressManPages() {
|
|
local dir="$1"
|
|
|
|
echo "gzipping man pages in $dir"
|
|
|
|
GLOBIGNORE=.:..:*.gz:*.bz2
|
|
|
|
for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
|
|
if [ -f "$f" -a ! -L "$f" ]; then
|
|
if gzip -c -n "$f" > "$f".gz; then
|
|
rm "$f"
|
|
else
|
|
rm "$f".gz
|
|
fi
|
|
fi
|
|
done
|
|
|
|
for f in "$dir"/share/man/*/* "$dir"/share/man/*/*/*; do
|
|
if [ -L "$f" -a -f `readlink -f "$f"`.gz ]; then
|
|
ln -sf `readlink "$f"`.gz "$f".gz && rm "$f"
|
|
fi
|
|
done
|
|
|
|
unset GLOBIGNORE
|
|
}
|