[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r2215 - tzdata/trunk/debian



Author: schizo
Date: 2007-05-11 19:23:08 +0000 (Fri, 11 May 2007)
New Revision: 2215

Modified:
   tzdata/trunk/debian/changelog
   tzdata/trunk/debian/config
Log:
  * debian/config: Use parameter expansion to get substrings,
    thereby eliminating use of sed.


Modified: tzdata/trunk/debian/changelog
===================================================================
--- tzdata/trunk/debian/changelog	2007-05-11 19:22:28 UTC (rev 2214)
+++ tzdata/trunk/debian/changelog	2007-05-11 19:23:08 UTC (rev 2215)
@@ -2,6 +2,8 @@
 
   * New Indonesian debconf translation by Arief S Fitrianto.
     closes: #423402.
+  * debian/config: Use parameter expansion to get substrings,
+    thereby eliminating use of sed.
 
  -- Clint Adams <schizo@debian.org>  Fri, 11 May 2007 11:14:37 -0400
 

Modified: tzdata/trunk/debian/config
===================================================================
--- tzdata/trunk/debian/config	2007-05-11 19:22:28 UTC (rev 2214)
+++ tzdata/trunk/debian/config	2007-05-11 19:23:08 UTC (rev 2215)
@@ -292,7 +292,8 @@
 
 # Read /etc/timezone
 if [ -e /etc/timezone ] ; then
-    TZ_TIMEZONE="$(head -n 1 /etc/timezone | sed -e "s/ .*//")"
+    TZ_TIMEZONE="$(head -n 1 /etc/timezone)"
+    TZ_TIMEZONE="${TZ_TIMEZONE%% *}"
     TZ_TIMEZONE="$(convert_timezone $TZ_TIMEZONE)"
     if ! [ -f "/usr/share/zoneinfo/$TZ_TIMEZONE" ] ; then
         TZ_TIMEZONE=""
@@ -301,7 +302,8 @@
 
 # Read /etc/localtime
 if [ -L /etc/localtime ] ; then
-    TZ_LOCALTIME="$(readlink /etc/localtime | sed 's%^/usr/share/zoneinfo/%%')"
+    TZ_LOCALTIME="$(readlink /etc/localtime)"
+    TZ_LOCALTIME="${TZ_LOCALTIME#/usr/share/zoneinfo/}"
     TZ_LOCALTIME="$(convert_timezone $TZ_LOCALTIME)"
     if ! [ -f "/usr/share/zoneinfo/$TZ_LOCALTIME" ] ; then
         TZ_LOCALTIME=""
@@ -315,8 +317,8 @@
 # The timezone has never been configured or is falsely configured
 if ! [ -e /etc/localtime ] ; then
     if [ -n "$TZ_TIMEZONE" ] ; then
-        AREA="$(echo $TZ_TIMEZONE | sed 's%/.*$%%')"
-        ZONE="$(echo $TZ_TIMEZONE | sed 's%^.*/%%')"
+        AREA="${TZ_LOCALTIME%/*}"
+        ZONE="${TZ_LOCALTIME##*/}"
     else
         AREA="Etc"
 	ZONE="UTC"
@@ -334,8 +336,8 @@
     fi
 # The timezone has already been configured
 else
-    AREA="$(echo $TZ_LOCALTIME | sed 's%/.*$%%')"
-    ZONE="$(echo $TZ_LOCALTIME | sed 's%^.*/%%')"
+    AREA="${TZ_LOCALTIME%/*}"
+    ZONE="${TZ_LOCALTIME##*/}"
     # Don't ask the user, except if he/she explicitely asked that
     if [ "$1" != "reconfigure" ] && [ -z "$DEBCONF_RECONFIGURE" ] ; then
         db_fset tzdata/Areas seen true



Reply to: