From a48f3355b49481dabe4dcaadc7bae3f56aba02fa Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Dec 13 2016 17:38:57 +0000 Subject: Revert "treecompose-post.sh: keep all supported LANGs" This reverts commit 7ce01e1dd1129553f291d6f3d1ebefe2142cc569. We'll do this differently. --- diff --git a/treecompose-post.sh b/treecompose-post.sh index 99f652d..b1221c2 100755 --- a/treecompose-post.sh +++ b/treecompose-post.sh @@ -8,52 +8,9 @@ echo 'Storage=persistent' >> /etc/systemd/journald.conf # Work around https://github.com/systemd/systemd/issues/4082 find /usr/lib/systemd/system/ -type f -exec sed -i -e '/^PrivateTmp=/d' -e '/^Protect\(Home\|System\)=/d' {} \; -# The loops below are too spammy otherwise... -set +x - # See: https://bugzilla.redhat.com/show_bug.cgi?id=1051816 -# and: https://bugzilla.redhat.com/show_bug.cgi?id=1186757 -KEEPLANGS=" -pt_BR -fr_FR -de_DE -it_IT -ru_RU -es_ES -en_US -zh_CN -ja_JP -ko_KR -zh_TW -as_IN -bn_IN -gu_IN -hi_IN -kn_IN -ml_IN -mr_IN -or_IN -pa_IN -ta_IN -te_IN -" - -find /usr/share/locale -mindepth 1 -maxdepth 1 -type d | while read locale; do - locale=$(basename $locale) - if ! grep -q "^$locale\$" <<< "$KEEPLANGS"; then - rm -rf "/usr/share/locale/$locale" - fi -done - -localedef --list-archive | while read locale; do - lang=${locale%%.*} - lang=${lang%%@*} - if [[ $locale != *.utf8 ]] || ! grep -q "$lang" <<< "$KEEPLANGS"; then - localedef --delete-from-archive "$locale" - fi -done - -set -x - +KEEPLANG=en_US +find /usr/share/locale -mindepth 1 -maxdepth 1 -type d -not -name "${KEEPLANG}" -exec rm -rf {} + +localedef --list-archive | grep -a -v ^"${KEEPLANG}" | xargs localedef --delete-from-archive cp -f /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl build-locale-archive