summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorUlrich Mueller <ulm@gentoo.org>2010-08-28 09:20:23 +0200
committerZac Medico <zmedico@gentoo.org>2010-08-28 16:12:11 -0700
commit59ea804b01cd711d4235e46e4cc4fdef8390d5fe (patch)
tree397852ab56ee19e7031b874cd335bf5a4bb02b46 /bin/ebuild.sh
parent87b1b094b789f414da007214bbd3f651671f084f (diff)
downloadportage-59ea804b01cd711d4235e46e4cc4fdef8390d5fe.tar.gz
portage-59ea804b01cd711d4235e46e4cc4fdef8390d5fe.tar.bz2
portage-59ea804b01cd711d4235e46e4cc4fdef8390d5fe.zip
Implement controllable compression and docompress, bug #273633.
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index b2ac5b419..393c82ebd 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -303,6 +303,8 @@ export EXEOPTIONS="-m0755"
export LIBOPTIONS="-m0644"
export DIROPTIONS="-m0755"
export MOPREFIX=${PN}
+declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
+declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
# adds ".keep" files so that dirs aren't auto-cleaned
keepdir() {
@@ -860,6 +862,32 @@ libopts() {
hasq -s ${LIBOPTIONS} && die "Never call libopts() with -s"
}
+docompress() {
+ hasq "${EAPI}" 0 1 2 3 && die "'docompress' not supported in this EAPI"
+
+ local f g
+ if [[ $1 = "-x" ]]; then
+ shift
+ for f; do
+ f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+ [[ ${f:0:1} = / ]] || f="/${f}"
+ for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
+ [[ ${f} = ${g} ]] && continue 2
+ done
+ PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
+ done
+ else
+ for f; do
+ f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+ [[ ${f:0:1} = / ]] || f="/${f}"
+ for g in "${PORTAGE_DOCOMPRESS[@]}"; do
+ [[ ${f} = ${g} ]] && continue 2
+ done
+ PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
+ done
+ fi
+}
+
abort_handler() {
local msg
if [ "$2" != "fail" ]; then