diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-08-15 22:03:44 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-08-15 22:03:44 +0000 |
commit | efabbeb77912f713439073a96caf3d7ef1819a5d (patch) | |
tree | 787251ba3055498f6a117538bdc616e659999acd /bin/ecompress | |
parent | 46da22f6de519fb48177b6194536b0704977bf5d (diff) | |
download | portage-efabbeb77912f713439073a96caf3d7ef1819a5d.tar.gz portage-efabbeb77912f713439073a96caf3d7ef1819a5d.tar.bz2 portage-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
Diffstat (limited to 'bin/ecompress')
-rwxr-xr-x | bin/ecompress | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/ecompress b/bin/ecompress index 1a51f9d63..c20bfa1e1 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) |