Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Oct 2010 15:18:40 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214060 - head/usr.sbin/pc-sysinstall/backend-query
Message-ID:  <201010191518.o9JFIeAh018816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010191518.o9JFIeAh018816>