From: Mike Frysinger Date: Sun, 1 Dec 2013 07:21:00 +0000 (-0500) Subject: docompress: add --limit support with newer EAPIs X-Git-Tag: v2.2.8~31 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e365ea81ad835ef2853e29925047d8ecb2754941;p=portage.git docompress: add --limit support with newer EAPIs We added support for not compressing files below a certain size (since the speed/size/etc... tradeoffs didn't make sense), but it was only for man pages and old EAPI's. Add the logic to the newer EAPIs and apply to all compressed paths. URL: http://bugs.gentoo.org/169260 --- diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 771bd0adb..bd99def32 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -156,7 +156,7 @@ prepcompress() { # Queue up for compression. # ecompress{,dir} doesn't like to be called with empty argument lists. - [[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --queue "${incl_d[@]}" + [[ ${#incl_d[@]} -gt 0 ]] && ecompressdir --limit ${PORTAGE_DOCOMPRESS_SIZE_LIMIT:-0} --queue "${incl_d[@]}" [[ ${#incl_f[@]} -gt 0 ]] && ecompress --queue "${incl_f[@]/#/${ED}}" [[ ${#exclude[@]} -gt 0 ]] && ecompressdir --ignore "${exclude[@]}" return 0 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index d03a4d7f8..ec48c94ec 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -11,6 +11,8 @@ export EXEOPTIONS="-m0755" export LIBOPTIONS="-m0644" export DIROPTIONS="-m0755" export MOPREFIX=${PN} +# Do not compress files which are smaller than this (in bytes). #169260 +export PORTAGE_DOCOMPRESS_SIZE_LIMIT="128" declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} ) declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html ) diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh index 2a3d5eaa0..7a31b89d4 100644 --- a/bin/save-ebuild-env.sh +++ b/bin/save-ebuild-env.sh @@ -14,7 +14,8 @@ __save_ebuild_env() { ( if has --exclude-init-phases $* ; then unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ \ - PORTAGE_DOCOMPRESS PORTAGE_DOCOMPRESS_SKIP + PORTAGE_DOCOMPRESS_SIZE_LIMIT PORTAGE_DOCOMPRESS \ + PORTAGE_DOCOMPRESS_SKIP if [[ -n $PYTHONPATH && ${PYTHONPATH%%:*} -ef $PORTAGE_PYM_PATH ]] ; then if [[ $PYTHONPATH == *:* ]] ; then