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