mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-02-10 16:37:20 +00:00
abuild: fix man pages compression
fix handling of hardlinks and symlinks. also compress n man pages and localized man pages
This commit is contained in:
parent
72fefe0f1d
commit
fe2332d186
27
abuild.in
27
abuild.in
@ -1438,9 +1438,30 @@ default_doc() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
# compress man pages
|
# compress man pages
|
||||||
find "$subpkgdir"/usr/share/man/*[1-9] \
|
local previnode= prevname= mandir="$subpkgdir"/usr/share/man
|
||||||
-type f \! -name \*.gz \! -name \*.bz2 2>/dev/null |
|
[ -d "$mandir" ] && find "$subpkgdir"/usr/share/man \
|
||||||
xargs -r gzip -9
|
-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"
|
rm -f "$subpkgdir/usr/share/info/dir"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user