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

r2509 - tzdata/trunk/debian



Author: aurel32
Date: 2007-08-16 16:41:08 +0000 (Thu, 16 Aug 2007)
New Revision: 2509

Added:
   tzdata/trunk/debian/preinst
Modified:
   tzdata/trunk/debian/changelog
   tzdata/trunk/debian/config
   tzdata/trunk/debian/postinst
Log:
  * Urgency set to high as it fixes an RC bug.
  * debian/configure: remove comparison of /etc/localtime
    with /usr/share/zoneinfo/.  closes: #438191.
    rework the rest of the script.
  * debian/preinst: new script to compare /etc/localtime
    with /usr/share/zoneinfo/.
  * debian/postinst: don't touch anything if /etc/timezone
    if not there.



Modified: tzdata/trunk/debian/changelog
===================================================================
--- tzdata/trunk/debian/changelog	2007-08-12 15:10:44 UTC (rev 2508)
+++ tzdata/trunk/debian/changelog	2007-08-16 16:41:08 UTC (rev 2509)
@@ -1,3 +1,16 @@
+tzdata (2007f-11) unstable; urgency=high
+
+  * Urgency set to high as it fixes an RC bug.
+  * debian/configure: remove comparison of /etc/localtime
+    with /usr/share/zoneinfo/.  closes: #438191.
+    rework the rest of the script.
+  * debian/preinst: new script to compare /etc/localtime
+    with /usr/share/zoneinfo/.
+  * debian/postinst: don't touch anything if /etc/timezone
+    if not there.
+
+ -- Aurelien Jarno <aurel32@debian.org>  Thu, 16 Aug 2007 14:07:30 -0230
+
 tzdata (2007f-10) unstable; urgency=low
 
   * New Catalan debconf translation from Jordà Polo.  closes: #431972.

Modified: tzdata/trunk/debian/config
===================================================================
--- tzdata/trunk/debian/config	2007-08-12 15:10:44 UTC (rev 2508)
+++ tzdata/trunk/debian/config	2007-08-16 16:41:08 UTC (rev 2509)
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh 
 set -e
 
 . /usr/share/debconf/confmodule
@@ -314,59 +314,43 @@
     esac
 }
 
-# Read /etc/timezone
-if [ -e /etc/timezone ] ; then
-    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=""
+# If /etc/localtime is a link, update /etc/timezone
+if [ -L /etc/localtime ] ; then
+    TIMEZONE="$(readlink /etc/localtime)"
+    TIMEZONE="${TIMEZONE#/usr/share/zoneinfo/}"
+    if [ -f "/usr/share/zoneinfo/$TIMEZONE" ] ; then
+        echo ${TIMEZONE} > /etc/timezone
     fi
 fi
 
-# Read /etc/localtime
-if [ -L /etc/localtime ] ; then
-    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=""
-    fi
-elif [ -f /etc/localtime ] && [ -n "$TZ_TIMEZONE" ] ; then
-    if cmp -s /etc/localtime /usr/share/zoneinfo/$TZ_TIMEZONE ; then
-        TZ_LOCALTIME=$TZ_TIMEZONE
-    fi
+# Read /etc/timezone
+if [ -e /etc/timezone ]; then
+    TIMEZONE="$(head -n 1 /etc/timezone)"
+    TIMEZONE="${TIMEZONE%% *}"
+    TIMEZONE="$(convert_timezone $TIMEZONE)"
+    AREA="${TIMEZONE%%/*}"
+    ZONE="${TIMEZONE#*/}"
 fi
 
+# The timezone is already configured
+if [ -e /etc/timezone ] && [ -e /etc/localtime ] ; then
+    # Don't ask the user, except if he/she explicitely asked that
+    if [ -z "$DEBCONF_RECONFIGURE" ] ; then
+        db_fset tzdata/Areas seen true
+        db_fset tzdata/Zones/$AREA seen true
+    fi
 # The timezone has never been configured or is falsely configured
-if ! [ -e /etc/localtime ] ; then
-    if [ -n "$TZ_TIMEZONE" ] ; then
-        AREA="${TZ_TIMEZONE%%/*}"
-        ZONE="${TZ_TIMEZONE#*/}"
-    else
+elif ! [ -e /etc/localtime ] || [ -n "$DEBCONF_RECONFIGURE" ] ; then
+    if [ -z "$TIMEZONE" ] ; then
         AREA="Etc"
-	ZONE="UTC"
-        db_fset tzdata/Areas seen false
-        db_fset tzdata/Zones/Etc seen false
+        ZONE="UTC"
+        echo "Etc/UTC" > /etc/timezone
     fi
+    db_fset tzdata/Areas seen false
+    db_fset tzdata/Zones/$AREA seen false
 # The user want to handle the timezone by him/herself
-elif [ -z "$TZ_LOCALTIME" ] ; then
-    if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ] ; then
-        AREA="Etc"
-	ZONE="UTC"
-    else
-        echo "User defined" > /etc/timezone
-	exit 0
-    fi
-# The timezone has already been configured
 else
-    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
-        db_fset tzdata/Zones/$AREA seen true
-    fi
+    exit 0
 fi
 
 # Initializes debconf default values from the ones found in
@@ -379,7 +363,7 @@
     case "$STATE" in
     0)
     	# The user has cancel the timezone change, reset the debconf
-	# values to the initial one.
+        # values to the initial one.
         db_set tzdata/Areas "$AREA"
         db_set tzdata/Zones/$AREA "$ZONE"
         break
@@ -394,9 +378,6 @@
         db_input high tzdata/Zones/$RET || true
         ;;
     *)
-        if grep -q "^User defined$" /etc/timezone 2>/dev/null ; then
-            rm -f /etc/timezone
-        fi
         break
         ;;
     esac
@@ -409,4 +390,5 @@
 
 #DEBHELPER#
 
+
 exit 0

Modified: tzdata/trunk/debian/postinst
===================================================================
--- tzdata/trunk/debian/postinst	2007-08-12 15:10:44 UTC (rev 2508)
+++ tzdata/trunk/debian/postinst	2007-08-16 16:41:08 UTC (rev 2509)
@@ -11,7 +11,8 @@
 
 if [ "$1" = configure ]; then
     # If the user prefers to manage the timezone by itself, let him doing that.
-    if grep -q "^User defined$" /etc/timezone 2>/dev/null ; then
+
+    if ! [ -e /etc/timezone ] && [ -z "$DEBCONF_RECONFIGURE" ] ; then
         db_stop
         echo
         echo "User defined timezone, leaving /etc/localtime unchanged."

Added: tzdata/trunk/debian/preinst
===================================================================
--- tzdata/trunk/debian/preinst	                        (rev 0)
+++ tzdata/trunk/debian/preinst	2007-08-16 16:41:08 UTC (rev 2509)
@@ -0,0 +1,23 @@
+#! /bin/sh
+set -e
+
+LC_ALL=C
+LANG=C
+
+
+if [ "$1" = upgrade ]; then
+    # If /etc/localtime has been modified, /etc/timezone is
+    # a nonsense, remove it.
+    if [ -f /etc/localtime ] && ! [ -L /etc/localtime ] && [ -e /etc/timezone ] ; then
+        TIMEZONE="$(head -n 1 /etc/timezone)"
+        TIMEZONE="${TIMEZONE%% *}"
+        if ! [ -f "/usr/share/zoneinfo/$TIMEZONE" ] || \
+           ! cmp -s /etc/localtime /usr/share/zoneinfo/$TIMEZONE ; then
+            rm -f /etc/timezone
+        fi
+    fi
+fi
+
+#DEBHELPER#
+
+exit 0



Reply to: