diff options
author | Bertrand Jacquin <beber@meleeweb.net> | 2014-08-27 23:19:28 +0200 |
---|---|---|
committer | Bertrand Jacquin <beber@meleeweb.net> | 2014-08-27 23:20:28 +0200 |
commit | 729f69dd890b36680a1cff3f794e708730a9a69f (patch) | |
tree | a397ea4e6b3f07d3765402f11706e7fc973110ac | |
parent | profiles/common: profile.bashrc: Rename __drop-man-nls (diff) | |
download | portage-729f69dd890b36680a1cff3f794e708730a9a69f.tar.xz |
profiles/common: profile.bashrc: Drop locales directory not defined in
LINGUAS
-rw-r--r-- | profiles/common/profile.bashrc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/profiles/common/profile.bashrc b/profiles/common/profile.bashrc index 24a80b4b..26b37d2e 100644 --- a/profiles/common/profile.bashrc +++ b/profiles/common/profile.bashrc @@ -22,6 +22,29 @@ function __drop-nls-man-pages () { done } +function __drop-nls-locales () { + if [[ ! ${ED} ]] ; then + local ED="${D}" + fi + + if [[ ! -d "${ED}/usr/share/locale" ]] ; then + return 0 + fi + + find "${ED}/usr/share/locale" \ + -mindepth 1 -maxdepth 1 \ + -type d | + sort | + while read ; do + if has "${REPLY}" ${LINGUAS} ; then + continue + fi + + einfo "Removing ${REPLY#${ED}}" + rm -rf "${REPLY}" + done +} + function __install_own_file () { if [[ ! ${ED} ]] ; then local ED="${D}" @@ -72,6 +95,7 @@ function post_src_install () { function pre_pkg_preinst () { __drop-nls-man-pages + __drop-nls-locales } # vim: syntax=sh |