diff options
author | 2015-07-21 02:28:16 +0000 | |
---|---|---|
committer | 2015-07-21 02:28:16 +0000 | |
commit | 7bdaf30d597a19c80ceead9dfc544af6fb88b1ed (patch) | |
tree | 5c4035d48d931f4882c82fd05b735a1da1779c51 | |
parent | extra/locale/locale-gen: source /lib/gentoo/functions.sh, bug #478764 (diff) | |
download | locale-gen-7bdaf30d597a19c80ceead9dfc544af6fb88b1ed.tar.gz locale-gen-7bdaf30d597a19c80ceead9dfc544af6fb88b1ed.tar.bz2 locale-gen-7bdaf30d597a19c80ceead9dfc544af6fb88b1ed.zip |
detect & warn & filter out duplicate locale generation entries #550884 by Toralf Förster
-rwxr-xr-x | locale-gen | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -52,7 +52,7 @@ show_usage() { } show_version() { local b="(" a=")" - local cvsver="$Revision: 1.36 $b $Date: 2014/12/28 18:45:18 $a" + local cvsver="$Revision: 1.37 $b $Date: 2015/07/21 02:28:16 $a" echo "locale-gen-${cvsver//: }" exit 0 } @@ -183,7 +183,17 @@ if [[ -z ${locales_to_generate} ]] && [[ -e ${CONFIG} ]] ; then locales_to_generate=$(sed \ -e 's:#.*::' \ -e '/^[[:space:]]*$/d' \ - "${CONFIG}") + "${CONFIG}" | sort) + # Sanity check to make sure people did not duplicate entries. #550884 + dup_locales_to_generate=$( + echo "${locales_to_generate}" | \ + uniq -c | \ + awk '$1 != "1" {$1 = ""; print}') + if [[ -n ${dup_locales_to_generate} ]] ; then + ewarn "These locales have been duplicated in your config:\n${dup_locales_to_generate}" + ewarn "They will be filtered, but you should still fix." + locales_to_generate=$(echo "${locales_to_generate}" | uniq) + fi fi if [[ -z ${locales_to_generate} ]] ; then |