svn commit: r214060 - head/usr.sbin/pc-sysinstall/backend-query

Ed Maste emaste at FreeBSD.org
Tue Oct 19 15:18:40 UTC 2010


Author: emaste
Date: Tue Oct 19 15:18:40 2010
New Revision: 214060
URL: http://svn.freebsd.org/changeset/base/214060

Log:
  Simplify and significantly speed up the timezone listing backend script.
  
  Reviewed by:	imp

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh	Tue Oct 19 15:12:16 2010	(r214059)
+++ head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh	Tue Oct 19 15:18:40 2010	(r214060)
@@ -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


More information about the svn-src-all mailing list