diff options
author | Ulrich Mueller <ulm@gentoo.org> | 2010-08-28 09:20:23 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-28 16:12:11 -0700 |
commit | 59ea804b01cd711d4235e46e4cc4fdef8390d5fe (patch) | |
tree | 397852ab56ee19e7031b874cd335bf5a4bb02b46 /bin/ebuild.sh | |
parent | 87b1b094b789f414da007214bbd3f651671f084f (diff) | |
download | portage-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-x | bin/ebuild.sh | 28 |
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 |