summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvapier <vapier>2015-08-29 04:44:58 +0000
committervapier <vapier>2015-08-29 04:44:58 +0000
commitf2bc69e289ee2c3dc035fa062540392f8302e9c5 (patch)
tree8023b2d096031465c091214eeab4644b61dfc4ab
parentimprove documentation greatly #235555 (diff)
downloadlocale-gen-f2bc69e289ee2c3dc035fa062540392f8302e9c5.tar.gz
locale-gen-f2bc69e289ee2c3dc035fa062540392f8302e9c5.tar.bz2
locale-gen-f2bc69e289ee2c3dc035fa062540392f8302e9c5.zip
locale-gen: detect non-unique locale names #235555
-rwxr-xr-xlocale-gen8
1 files changed, 4 insertions, 4 deletions
diff --git a/locale-gen b/locale-gen
index 0122830..449a285 100755
--- a/locale-gen
+++ b/locale-gen
@@ -52,7 +52,7 @@ show_usage() {
}
show_version() {
local b="(" a=")"
- local cvsver="$Revision: 1.37 $b $Date: 2015/07/21 02:28:16 $a"
+ local cvsver="$Revision: 1.38 $b $Date: 2015/08/29 04:44:58 $a"
echo "locale-gen-${cvsver//: }"
exit 0
}
@@ -185,13 +185,13 @@ if [[ -z ${locales_to_generate} ]] && [[ -e ${CONFIG} ]] ; then
-e '/^[[:space:]]*$/d' \
"${CONFIG}" | sort)
# Sanity check to make sure people did not duplicate entries. #550884
+ # The first column must be unique specifically. #235555
dup_locales_to_generate=$(
echo "${locales_to_generate}" | \
- uniq -c | \
- awk '$1 != "1" {$1 = ""; print}')
+ awk '{ if ($1 == last) { print lastline; print; } else { lastline = $0; last = $1; } }')
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."
+ ewarn "Some might be filtered, but you must fix it."
locales_to_generate=$(echo "${locales_to_generate}" | uniq)
fi
fi