diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2015-10-17 16:50:42 +0100 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2015-10-17 17:43:34 +0100 |
commit | 37717e5513c8aada92115c42cb3ccdb71b1958eb (patch) | |
tree | 88336379cbc8dbf2ace0c6e5c4998c2e97b7d4d0 | |
parent | profiles/enlightenment/build/build-dependencies: Enable PYTHON_TARGETS (diff) | |
download | portage-37717e5513c8aada92115c42cb3ccdb71b1958eb.tar.xz |
profiles/common: Enhance __drop-nls-man-pages to drop directories
outside of /usr/share/man
-rw-r--r-- | profiles/common/profile.bashrc | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/profiles/common/profile.bashrc b/profiles/common/profile.bashrc index 470c2c17..3113fb93 100644 --- a/profiles/common/profile.bashrc +++ b/profiles/common/profile.bashrc @@ -1,21 +1,30 @@ function __drop-nls-man-pages () { - # FEATURES=noman already take care of deleting man-pages - if has noman ${FEATURES} ; then - return 0 - fi + local -a _DIRS=( + /usr/share/man + /usr/share/postgresql-*/man + ) - if [[ ! -d "${_ed}/usr/share/man" ]] ; then - return 0 - fi + local _dir + for _dir in "${_DIRS[@]}" ; do + if [[ ! -d "${_ed}/${_dir}" ]] ; then + continue + fi - find "${_ed}/usr/share/man" \ - -mindepth 1 -maxdepth 1 \ - -type d \ - -name 'man*' -prune -o -print | - sort | - while read ; do - einfo "Removing ${REPLY#${_ed}}" - rm -rf "${REPLY}" + if has noman ${FEATURES} ; then + einfo "Removing ${_dir#${_ed}}" + rm -rf "${_ed}/${_dir}" + else + # Drop non man? directories + find "${_ed}${_dir}" + -mindepth 1 -maxdepth 1 \ + -type d \ + -name 'man*' -prune -o -print | + sort | + while read ; do + einfo "Removing ${REPLY#${_ed}}" + rm -rf "${REPLY}" + done + fi done } |