summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-09-27 02:46:19 -0400
committerMike Frysinger <vapier@gentoo.org>2021-09-27 02:46:19 -0400
commit692486a6d5b757f485e15a7acf269fd1bf28d970 (patch)
tree54331415b57a338d07537d3a169e65c61f07dc0b
parentfix hint about use of / in locale names (diff)
downloadlocale-gen-692486a6d5b757f485e15a7acf269fd1bf28d970.tar.gz
locale-gen-692486a6d5b757f485e15a7acf269fd1bf28d970.tar.bz2
locale-gen-692486a6d5b757f485e15a7acf269fd1bf28d970.zip
switch from tr to bash builtin ${var,,}
This seems to speed things up. Or I'm lying to myself. Either way. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xlocale-gen7
1 files changed, 4 insertions, 3 deletions
diff --git a/locale-gen b/locale-gen
index c746eef..9759daa 100755
--- a/locale-gen
+++ b/locale-gen
@@ -196,10 +196,11 @@ fi
# https://sourceware.org/git/?p=glibc.git;a=blob;f=locale/programs/localedef.c;hb=glibc-2.34#l562
normalize() {
if [[ $1 == *.* ]] ; then
- local ret=$(echo ${1##*.} | tr '[[:upper:]]' '[[:lower:]]')
- echo ${1%%.*}.${ret//-}
+ local ret=${1##*.}
+ ret=${ret,,}
+ echo "${1%%.*}.${ret//-}"
else
- echo $1
+ echo "$1"
fi
}