Skip to content

Commit c5252e1

Browse files
authored
compress-man-pages: optimize, use multiple cores (#406922)
2 parents ca81772 + 8d022c6 commit c5252e1

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

pkgs/build-support/setup-hooks/compress-man-pages.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ compressManPages() {
99
echo "gzipping man pages under $dir/share/man/"
1010

1111
# Compress all uncompressed manpages. Don't follow symlinks, etc.
12+
# gzip -f is needed to not error out on hard links.
1213
find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \
13-
| while IFS= read -r -d $'\0' f
14-
do
15-
if gzip -c -n "$f" > "$f".gz; then
16-
rm "$f"
17-
else
18-
rm "$f".gz
19-
fi
20-
done
14+
| xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -f
2115

2216
# Point symlinks to compressed manpages.
2317
find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \

0 commit comments

Comments
 (0)