Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] omitting redirecting man pages from compression
Date: Mon, 20 Sep 2010 00:07:41
Message-Id: 201009191943.50988.vapier@gentoo.org
1 many man pages exist merely as a redirect to another man page:
2 $ xzcat /usr/share/man/man1/zcat.1.xz
3 .so man1/gzip.1
4
5 compressing these tiny (always?) results in a larger file. that means we
6 arent saving space, and we're adding overhead at runtime.
7
8 two options which we can do transparently:
9 - rewrite the .so man pages into symlinks
10 - omit them from compression
11
12 the latter is pretty easy (see below). any preferences on which route to take
13 though as the former shouldnt be too hard either ...
14
15 --- a/bin/ebuild-helpers/ecompressdir
16 +++ b/bin/ebuild-helpers/ecompressdir
17 @@ -13,6 +13,7 @@ case $1 in
18 --ignore)
19 shift
20 for skip in "$@" ; do
21 + skip=${skip#${D}}
22 [[ -d ${D}${skip} || -f ${D}${skip} ]] \
23 && touch "${D}${skip}.ecompress.skip"
24 done
25 --- a/bin/ebuild-helpers/prepman
26 +++ b/bin/ebuild-helpers/prepman
27 @@ -27,6 +27,10 @@ for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
28 [[ -d ${subdir} ]] && really_is_mandir=1 && break
29 done
30
31 -[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --queue "${mandir#${D}}"
32 +if [[ ${really_is_mandir} == 1 ]] ; then
33 + ecompressdir --queue "${mandir#${D}}" || exit 1
34 + # compressing small files just adds overhead
35 + find "${mandir}" -type f '!' -size +100c -print0 | ${XARGS} -0 ecompressdir --ignore
36 +fi
37
38 exit 0
39 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies