1 # This hook compresses info(1) files.
4 local f j dirat lnkat newlnk
5 local fpattern
="s|${PKGDESTDIR}||g;s|^\./$||g;/^$/d"
7 # Find out if this package contains info files and compress
10 if [ ! -f ${PKGDESTDIR}/usr
/share
/info
/dir
]; then
13 # Always remove this file if curpkg is not texinfo.
14 if [ "$pkgname" != "texinfo" ]; then
15 rm -f ${PKGDESTDIR}/usr
/share
/info
/dir
18 find ${PKGDESTDIR}/usr
/share
/info
-type f
-follow |
while read -r f
; do
19 j
=$
(echo "$f"|
sed -e "$fpattern")
20 [ "$j" = "" ] && continue
21 [ "$j" = "/usr/share/info/dir" ] && continue
22 # Ignore compressed files.
23 if [[ "$j" =~ .
*.gz$
]]; then
26 # Ignore non info files.
27 if ! [[ "$j" =~ .
*.info$
]] && ! [[ "$j" =~ .
*.info-
[0-9]*$
]]; then
30 if [ -h ${PKGDESTDIR}/"$j" ]; then
32 lnkat
=$
(readlink
${PKGDESTDIR}/"$j")
34 rm -f ${PKGDESTDIR}/"$j"
35 cd ${PKGDESTDIR}/"$dirat"
36 ln -s "${lnkat}".gz
"${newlnk}".gz
39 echo " Compressing info file: $j..."
40 gzip -nfq9 ${PKGDESTDIR}/"$j"