2 ===================================================================
3 --- dodoc (revision 5536)
4 +++ dodoc (working copy)
7 -# Copyright 1999-2006 Gentoo Foundation
8 +# Copyright 1999-2007 Gentoo Foundation
9 # Distributed under the terms of the GNU General Public License v2
12 if [ $# -lt 1 ] ; then
13 - echo "$0: at least one argument needed" 1>&2
14 + vecho "${0##*/}: at least one argument needed" 1>&2
18 @@ -16,7 +17,7 @@ ret=0
20 if [ -s "${x}" ] ; then
21 install -m0644 "${x}" "${dir}"
22 - gzip -f -9 "${dir}/${x##*/}"
23 + ecompress "${dir}/${x##*/}"
24 elif [ ! -e "${x}" ] ; then
25 echo "dodoc: ${x} does not exist" 1>&2
28 ===================================================================
29 --- prepallman (revision 5536)
30 +++ prepallman (working copy)
33 -# Copyright 1999-2006 Gentoo Foundation
34 +# Copyright 1999-2007 Gentoo Foundation
35 # Distributed under the terms of the GNU General Public License v2
38 @@ -7,14 +7,11 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/por
43 -for x in "${D}"opt/*/man "${D}"usr/share/man "${D}"usr/local/man "${D}"usr/X11R6/man ; do
44 - if [[ -d ${x} ]] ; then
51 +find "${D}" -type d -name man > "${T}"/prepallman.filelist
52 +while read mandir ; do
53 + mandir=${mandir#${D}}
54 + prepman "${mandir%/man}"
56 +done < "${T}"/prepallman.filelist
60 ===================================================================
61 --- prepman (revision 5536)
62 +++ prepman (working copy)
65 -# Copyright 1999-2006 Gentoo Foundation
66 +# Copyright 1999-2007 Gentoo Foundation
67 # Distributed under the terms of the GNU General Public License v2
70 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
73 - z="${D}usr/share/man"
74 + mandir="${D}usr/share/man"
80 -if [[ ! -d ${z} ]] ; then
81 - eqawarn "QA Notice: prepman called with non-existent dir '${z#${D}}'"
82 +if [[ ! -d ${mandir} ]] ; then
83 + eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${D}}'"
87 -for x in $(find "${z}"/ -type d 2>/dev/null) ; do
88 - for y in $(find "${x}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) ! -name '.keep_*' 2>/dev/null) ; do
89 - if [[ -L ${y} ]] ; then
92 - linkto=$(readlink "${y}")
94 - # Do NOT change links to directories
95 - if [[ -d ${z}/${linkto} ]] ; then
99 - if [[ ${linkto##*.} != "gz" ]] && [[ ${linkto##*.} != "bz2" ]] ; then
100 - linkto="${linkto}.gz"
102 - if [[ ${mylink##*.} != "gz" ]] && [[ ${mylink##*.} != "bz2" ]] ; then
103 - mylink="${mylink}.gz"
106 - vecho "fixing man page symlink: ${mylink##*/}"
107 - ln -snf "${linkto}" "${mylink}"
108 - if [[ ${y} != "${mylink}" ]] ; then
109 - vecho "removing old symlink: ${y##*/}"
113 - if [[ ${y##*.} != "gz" ]] && [[ ${y##*.} != "bz2" ]] && [[ ! -d ${y} ]] ; then
114 - vecho "gzipping man page: ${y##*/}"
121 +# figure out the new suffix
122 +suffix=$(ecompress --suffix)
123 +[[ -z ${suffix} ]] && exit 0
127 +# compress and fixup links in each dir
128 +for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
129 + ecompressdir "${subdir#${D}}"
134 Index: misc-functions.sh
135 ===================================================================
136 --- misc-functions.sh (revision 5536)
137 +++ misc-functions.sh (working copy)
138 @@ -340,9 +340,7 @@ install_qa_check() {
141 # Portage regenerates this on the installed system.
142 - if [[ -f ${D}/usr/share/info/dir.gz ]] ; then
143 - rm -f "${D}"/usr/share/info/dir.gz
145 + rm -f "${D}"/usr/share/info/dir{,.gz,.bz2}
147 if hasq multilib-strict ${FEATURES} && \
148 [[ -x /usr/bin/file && -x /usr/bin/find ]] && \
150 ===================================================================
151 --- doinfo (revision 5536)
152 +++ doinfo (working copy)
155 -# Copyright 1999-2006 Gentoo Foundation
156 +# Copyright 1999-2007 Gentoo Foundation
157 # Distributed under the terms of the GNU General Public License v2
160 if [ ${#} -lt 1 ] ; then
161 - echo "doinfo: at least one argument needed"
162 + vecho "${0##*/}: at least one argument needed"
165 if [ ! -d "${D}usr/share/info" ] ; then
168 if [ -e "${x}" ] ; then
169 install -m0644 "${x}" "${D}usr/share/info"
170 - gzip -f -9 "${D}usr/share/info/${x##*/}"
171 + ecompress "${D}usr/share/info/${x##*/}"
173 echo "doinfo: ${x} does not exist"
176 ===================================================================
177 --- prepinfo (revision 5536)
178 +++ prepinfo (working copy)
181 -# Copyright 1999-2006 Gentoo Foundation
182 +# Copyright 1999-2007 Gentoo Foundation
183 # Distributed under the terms of the GNU General Public License v2
186 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
188 -if [ -z "$1" ] ; then
189 - z="${D}usr/share/info"
190 +if [[ -z $1 ]] ; then
191 + infodir=="${D}usr/share/info"
193 - if [ -d "${D}$1/share/info" ] ; then
194 - z="${D}$1/share/info"
195 + if [[ -d ${D}$1/share/info ]] ; then
196 + infodir="${D}$1/share/info"
199 + infodir="${D}$1/info"
203 -[ ! -d "${z}" ] && exit 0
204 +[[ ! -d ${infodir} ]] && exit 0
206 -rm -f "${z}"/{dir,dir.info,dir.info.gz}
207 +rm -f "${infodir}"/dir{,.info}{,.gz,.bz2}
209 -for x in $(find "${z}"/ -mindepth 1 -maxdepth 1 \( -type f -or -type l \) 2>/dev/null) ; do
210 - if [ -L "${x}" ] ; then
213 - linkto="$(readlink "${x}")"
215 - if [ "${linkto##*.}" != "gz" ] ; then
216 - linkto="${linkto}.gz"
218 - if [ "${mylink##*.}" != "gz" ] ; then
219 - mylink="${mylink}.gz"
222 - vecho "fixing GNU info symlink: ${mylink##*/}"
223 - ln -snf "${linkto}" "${mylink}"
224 - if [ "${x}" != "${mylink}" ] ; then
225 - vecho "removing old symlink: ${x##*/}"
229 - if [ "${x##*.}" != "gz" ] ; then
230 - vecho "gzipping GNU info page: ${x##*/}"
235 +exec ecompressdir "${infodir}"
237 ===================================================================
238 --- ecompress (revision 0)
239 +++ ecompress (revision 0)
242 +# Copyright 1999-2007 Gentoo Foundation
243 +# Distributed under the terms of the GNU General Public License v2
244 +# $Id: prepman 5507 2007-01-10 04:22:27Z zmedico $
246 +if [[ -z $1 ]] ; then
247 + echo "${0##*/}: at least one argument needed" 1>&2
251 +source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
253 +# setup compression stuff
254 +PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-bzip2}
255 +if [[ -z ${PORTAGE_COMPRESS_FLAGS} ]] ; then
256 + case ${PORTAGE_COMPRESS} in
257 + bzip2|gzip) PORTAGE_COMPRESS_FLAGS="-9";;
261 +if [[ $1 == "--suffix" ]] ; then
263 + tmpdir="${T}"/.ecompress$$.${RANDOM}
266 + # we have to fill the file enough so that there is something
267 + # to compress as some programs will refuse to do compression
268 + # if it cannot actually compress the file
269 + echo {0..1000} > compressme
270 + ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS} compressme
271 + suffix=$(ls compressme*)
272 + suffix=${suffix#compressme}
277 + exec "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} "$@"
280 Property changes on: ecompress
281 ___________________________________________________________________
286 ===================================================================
287 --- prepalldocs (revision 5536)
288 +++ prepalldocs (working copy)
291 -# Copyright 1999-2006 Gentoo Foundation
292 +# Copyright 1999-2007 Gentoo Foundation
293 # Distributed under the terms of the GNU General Public License v2
296 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
297 +if [[ -n $1 ]] ; then
298 + vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
301 -z="$(find "${D}"usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null)"
303 +[[ -d usr/share/doc ]] || exit 0
306 - if [ -L "${y}" ] ; then
309 - linkto="$(readlink "${y}")"
311 - if [ "${linkto##*.}" != "gz" ] ; then
312 - linkto="${linkto}.gz"
314 - if [ "${mylink##*.}" != "gz" ] ; then
315 - mylink="${mylink}.gz"
318 - vecho "fixing doc symlink: ${mylink##*/}"
319 - ln -snf "${linkto}" "${mylink}"
320 - if [ "${y}" != "${mylink}" ] ; then
321 - vecho "removing old symlink: ${y##*/}"
325 - if [ "${y##*.}" != "gz" ] ; then
326 - vecho "gzipping doc: ${y##*/}"
331 +exec ecompressdir "${D}"usr/share/doc
333 ===================================================================
334 --- ecompressdir (revision 0)
335 +++ ecompressdir (revision 0)
338 +# Copyright 1999-2007 Gentoo Foundation
339 +# Distributed under the terms of the GNU General Public License v2
340 +# $Id: prepalldocs 3483 2006-06-10 21:40:40Z genone $
342 +if [[ -z $1 ]] ; then
343 + echo "${0##*/}: at least one argument needed" 1>&2
347 +# figure out the new suffix
348 +suffix=$(ecompress --suffix)
349 +[[ -z ${suffix} ]] && exit 0
351 +source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
355 +for dir in "$@" ; do
357 + if [[ ! -d ${dir} ]] ; then
358 + vecho "${0##*/}: ${dir#${D}} does not exist!"
361 + vecho "${0##*/}: compressing ${dir#${D}}"
364 + find "${dir}" -type f -print0 | xargs -0 ecompress
366 + find -L "${dir}" -type l | \
367 + while read brokenlink ; do
368 + olddest=$(readlink "${brokenlink}")
369 + newdest="${olddest}${suffix}"
370 + if [[ -e ${newdest} ]] ; then
371 + ln -snf "${newdest}" "${brokenlink}"
374 + vecho "ecompressdir: unknown broken symlink: ${brokenlink}"
382 Property changes on: ecompressdir
383 ___________________________________________________________________