summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-15 22:03:44 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-15 22:03:44 +0000
commitefabbeb77912f713439073a96caf3d7ef1819a5d (patch)
tree787251ba3055498f6a117538bdc616e659999acd
parentFor consistency, make get_open_fds() return a plain iterator in any case, (diff)
downloadportage-idfetch-efabbeb77912f713439073a96caf3d7ef1819a5d.tar.gz
portage-idfetch-efabbeb77912f713439073a96caf3d7ef1819a5d.tar.bz2
portage-idfetch-efabbeb77912f713439073a96caf3d7ef1819a5d.zip
Bug #172496 - Add a PORTAGE_COMPRESS_EXCLUDE_SUFFIXES config variable which
is used to filter ecompress arguments. This allows the user to control compression of files installed dodoc, excluding files with specific suffix patterns. The current default value includes all of the suffixes that are recognized by dohtml, as well as pdf. svn path=/main/trunk/; revision=11419
-rwxr-xr-xbin/ecompress16
-rw-r--r--cnf/make.globals3
-rw-r--r--man/make.conf.57
3 files changed, 26 insertions, 0 deletions
diff --git a/bin/ecompress b/bin/ecompress
index 1a51f9d6..c20bfa1e 100755
--- a/bin/ecompress
+++ b/bin/ecompress
@@ -63,6 +63,22 @@ case $1 in
exit 1
;;
*)
+ mask_ext_re=""
+ set -f
+ for x in $PORTAGE_COMPRESS_EXCLUDE_SUFFIXES ; do
+ mask_ext_re+="|$x"
+ done
+ set +f
+ mask_ext_re="^(${mask_ext_re:1})\$"
+ declare -a filtered_args=()
+ i=0
+ for x in "$@" ; do
+ [[ ${x##*.} =~ $mask_ext_re ]] && continue
+ filtered_args[$i]=$x
+ (( i++ ))
+ done
+ set "${filtered_args[@]}"
+
# If a compressed version of the file already exists, simply
# delete it so that the compressor doesn't whine (bzip2 will
# complain and skip, gzip will prompt for input)
diff --git a/cnf/make.globals b/cnf/make.globals
index 00596162..f379fb1c 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -56,6 +56,9 @@ EMERGE_WARNING_DELAY="10"
# This option will be removed and forced to yes.
AUTOCLEAN="yes"
+# Don't compress files with these suffixes.
+PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png"
+
# Number of mirrors to try when a downloaded file has an incorrect checksum.
PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5"
diff --git a/man/make.conf.5 b/man/make.conf.5
index c6020303..6eab4b2d 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -430,6 +430,13 @@ install phase.
\fBPORTAGE_COMPRESS_FLAGS\fR = \fI"\-9"\fR
This variable contains flags for the \fBPORTAGE_COMPRESS\fR command.
.TP
+.TP
+\fBPORTAGE_COMPRESS_EXCLUDE_SUFFIXES\fR = \fI"gif htm[l]? jp[e]?g pdf png"\fR
+This variable contains a space delimited list of file suffixes for which
+matching files are excluded when the \fBPORTAGE_COMPRESS\fR command is
+called. Regular expressions are supported and the match is performed only
+against the portion of the file name which follows the last period character.
+.TP
.B PORTAGE_ELOG_CLASSES
.TP
.B PORTAGE_ELOG_SYSTEM