Simplify and significantly speed up the timezone listing backend script.

Reviewed by:	imp
This commit is contained in:
Ed Maste 2010-10-19 15:18:40 +00:00
parent 161a621b47
commit bb5c5f84fa
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214060

View File

@ -25,19 +25,10 @@
#
# $FreeBSD$
rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
# Backend script which lists all the available timezones for front-ends to display
while read line
do
echo "$line" | grep "^#" >/dev/null 2>/dev/null
if [ "$?" != "0" ]
then
echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp
fi
done < /usr/share/zoneinfo/zone.tab
sort ${TMPDIR}/.tzonetmp
rm -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null
egrep -v '^#' /usr/share/zoneinfo/zone.tab |\
tr -s "\t" ":" |\
cut -d ":" -f 3-4 |\
sort
exit 0