r2209 - tzdata/tags/2007e-8/debian
Author: schizo
Date: 2007-05-11 16:55:03 +0000 (Fri, 11 May 2007)
New Revision: 2209
Modified:
tzdata/tags/2007e-8/debian/changelog
tzdata/tags/2007e-8/debian/config
Log:
* debian/config: Use parameter expansion to get substrings,
thereby eliminating use of sed.
Modified: tzdata/tags/2007e-8/debian/changelog
===================================================================
--- tzdata/tags/2007e-8/debian/changelog 2007-05-11 15:16:02 UTC (rev 2208)
+++ tzdata/tags/2007e-8/debian/changelog 2007-05-11 16:55:03 UTC (rev 2209)
@@ -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/tags/2007e-8/debian/config
===================================================================
--- tzdata/tags/2007e-8/debian/config 2007-05-11 15:16:02 UTC (rev 2208)
+++ tzdata/tags/2007e-8/debian/config 2007-05-11 16:55:03 UTC (rev 2209)
@@ -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: