Commit fe2332d1 authored by Natanael Copa's avatar Natanael Copa

abuild: fix man pages compression

fix handling of hardlinks and symlinks.
also compress n man pages and localized man pages
parent 72fefe0f
......@@ -1438,9 +1438,30 @@ default_doc() {
done
# compress man pages
find "$subpkgdir"/usr/share/man/*[1-9] \
-type f \! -name \*.gz \! -name \*.bz2 2>/dev/null |
xargs -r gzip -9
local previnode= prevname= mandir="$subpkgdir"/usr/share/man
[ -d "$mandir" ] && find "$subpkgdir"/usr/share/man \
-type f \( -name \*.[0-9n] -o -name \*.[0-9][a-z]* \) \
-exec stat -c "%i %n" {} \; | sort -n \
| while read inode name; do
if [ "$inode" = "$previnode" ]; then
# update hard link
rm "$name"
ln "$prevname".gz "$name".gz
else
gzip -9 "$name"
fi
previnode="$inode"
prevname="$name"
done
[ -d "$mandir" ] && find "$subpkgdir"/usr/share/man \
-type l \( -name \*.[0-9n] -o -name \*.[0-9][a-z]* \) \
| while read symlink; do
ln -s $(readlink $symlink).gz "$symlink".gz
rm "$symlink"
done
rm -f "$subpkgdir/usr/share/info/dir"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment