r1381 - in glibc-package/trunk/debian: . local/manpages local/usr_sbin
Author: aurel32
Date: 2006-04-10 06:22:16 +0000 (Mon, 10 Apr 2006)
New Revision: 1381
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/local/manpages/tzconfig.8
glibc-package/trunk/debian/local/usr_sbin/tzconfig
Log:
* local/usr_sbin/tzconfig:
- Put a copy of the current timezone into /etc/localtime instead of a
symlink. (Closes: #346342, #345907)
- Handle the case where /etc/localtime does not exists. (Closes:
#360383).
* local/manpages/tzconfig.8: Update the manpage accordingly.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2006-04-10 05:07:13 UTC (rev 1380)
+++ glibc-package/trunk/debian/changelog 2006-04-10 06:22:16 UTC (rev 1381)
@@ -4,6 +4,12 @@
* Build a libc6-xen flavour on i386.
* Fix a typo in the description of the libc6-sparcv9 and libc6-sparcv9b
packages.
+ * local/usr_sbin/tzconfig:
+ - Put a copy of the current timezone into /etc/localtime instead of a
+ symlink. (Closes: #346342, #345907)
+ - Handle the case where /etc/localtime does not exists. (Closes:
+ #360383).
+ * local/manpages/tzconfig.8: Update the manpage accordingly.
-- Aurelien Jarno <aurel32@debian.org> Mon, 10 Apr 2006 06:40:33 +0200
Modified: glibc-package/trunk/debian/local/manpages/tzconfig.8
===================================================================
--- glibc-package/trunk/debian/local/manpages/tzconfig.8 2006-04-10 05:07:13 UTC (rev 1380)
+++ glibc-package/trunk/debian/local/manpages/tzconfig.8 2006-04-10 06:22:16 UTC (rev 1381)
@@ -78,10 +78,12 @@
.SH Internals
The work done by
.B tzconfig
-is actually pretty simple. It just updates the link
+is actually pretty simple. It just copies the correct timezone installed in
+.I /usr/share/zoneinfo/
+to
.I /etc/localtime
-to point to the correct timezone installed in
-.IR /usr/share/zoneinfo/ .
+and puts the name of the timezone into
+.IR /etc/timezone .
There is nothing wrong with doing this manually. However, using
.B tzconfig
Modified: glibc-package/trunk/debian/local/usr_sbin/tzconfig
===================================================================
--- glibc-package/trunk/debian/local/usr_sbin/tzconfig 2006-04-10 05:07:13 UTC (rev 1380)
+++ glibc-package/trunk/debian/local/usr_sbin/tzconfig 2006-04-10 06:22:16 UTC (rev 1381)
@@ -44,17 +44,15 @@
TIMEZONES=$(tempfile -p time) || TIMEZONES=/etc/timezone.$$
-if [ -f /etc/timezone ]; then
- echo "Your current time zone is set to `cat /etc/timezone`"
- echo -n "Do you want to change that? [n]: "
- read ans
- if [ "x$ans" = "x" ] || [ "$ans" = "n" ] || [ "$ans" = "no" ]; then
- echo "Your time zone will not be changed"
- exit 0
+if [ -f /etc/timezone ] || [ -f /etc/localtime ] ; then
+ current_timezone="Unknown"
+ if [ -L /etc/localtime ] ; then
+ current_timezone=$(readlink /etc/localtime | sed 's%^/usr/share/zoneinfo/%%')
+ elif [ -f /etc/timezone ] && [ -f /etc/localtime ]; then
+ current_timezone=$(cat /etc/timezone)
fi
-elif [ -L /etc/localtime ]; then
- oldtimezone=$(readlink /etc/localtime | sed 's%^/usr/share/zoneinfo/%%')
- echo "Your current time zone is set to $oldtimezone"
+
+ echo "Your current time zone is set to $current_timezone"
echo -n "Do you want to change that? [n]: "
read ans
if [ "x$ans" = "x" ] || [ "$ans" = "n" ] || [ "$ans" = "no" ]; then
@@ -63,7 +61,6 @@
fi
fi
-
( cd /usr/share/zoneinfo ; find . -type f | sed -e 's/^.\///' | sort > $TIMEZONES )
valid=no
while [ $valid = no ]; do
@@ -119,6 +116,5 @@
done
echo $timezone > /etc/timezone
-#zic -l $timezone
-rm -f /etc/localtime && ln -sf /usr/share/zoneinfo/$timezone /etc/localtime
+rm -f /etc/localtime && cp -f /usr/share/zoneinfo/$timezone /etc/localtime
trap 'rm -f $TIMEZONES' 0 1 2 3 13 15
Reply to: