summaryrefslogtreecommitdiff
path: root/profiles/common
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2018-03-06 00:00:28 +0000
committerBertrand Jacquin <bertrand@jacquin.bzh>2018-03-18 14:25:36 +0000
commitb11d107def4686f06ed46da2277c639cd08d5153 (patch)
tree4dec2f4ed106188772bd9291d47f4bbb80537613 /profiles/common
parentprofiles/common: Use appropriate variable name (diff)
downloadportage-b11d107def4686f06ed46da2277c639cd08d5153.tar.xz
profiles/common: Handle /usr/share/help as /usr/share/locale
Diffstat (limited to 'profiles/common')
-rw-r--r--profiles/common/profile.bashrc35
1 files changed, 22 insertions, 13 deletions
diff --git a/profiles/common/profile.bashrc b/profiles/common/profile.bashrc
index c1861bc7..30b633d4 100644
--- a/profiles/common/profile.bashrc
+++ b/profiles/common/profile.bashrc
@@ -85,23 +85,32 @@ function __drop-nls-man-pages () {
}
function __drop-nls-locales () {
- if [[ ! -d "${_ed}/usr/share/locale" ]] ; then
- return 0
- fi
+ local -a _DIRS=(
+ /usr/share/locale
+ /usr/share/help
+ )
- find "${_ed}/usr/share/locale" \
- -mindepth 1 -maxdepth 1 \
- -type d |
- sort |
- while read ; do
- if has "${REPLY##*/}" ${LINGUAS} ; then
- continue
- elif has "${REPLY##*/}" ${L10N} ; then
+ local _dir _l
+ for _dir in ${_DIRS[@]} ; do
+ if [[ ! -d "${_ed}${_dir}" ]] ; then
continue
fi
- einfo "Removing ${REPLY#${_ed}}"
- rm -rf "${REPLY}"
+ find "${_ed}${_dir}" \
+ -mindepth 1 -maxdepth 1 \
+ -type d |
+ sort |
+ while read ; do
+ _l="${REPLY##*/}"
+ if has "${_l}" ${LINGUAS} ; then
+ continue
+ elif has "${_l/_/-}" ${L10N} ; then
+ continue
+ fi
+
+ einfo "Removing ${REPLY#${_ed}}"
+ rm -rf "${REPLY}"
+ done
done
}