diff options
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 |