r2054 - tzdata/trunk/debian
Author: aurel32
Date: 2007-04-13 22:21:16 +0000 (Fri, 13 Apr 2007)
New Revision: 2054
Modified:
tzdata/trunk/debian/changelog
tzdata/trunk/debian/control
tzdata/trunk/debian/postinst
tzdata/trunk/debian/rules
Log:
Switch to debconf (closes: bug#391529).
Modified: tzdata/trunk/debian/changelog
===================================================================
--- tzdata/trunk/debian/changelog 2007-04-13 10:52:31 UTC (rev 2053)
+++ tzdata/trunk/debian/changelog 2007-04-13 22:21:16 UTC (rev 2054)
@@ -1,3 +1,9 @@
+tzdata (2007e-2) unstable; urgency=low
+
+ * Switch to debconf (closes: bug#391529).
+
+ -- Aurelien Jarno <aurel32@debian.org> Sat, 14 Apr 2007 00:03:20 +0200
+
tzdata (2007e-1) unstable; urgency=low
* New upstream release.
@@ -2,2 +8,3 @@
- Fixes for Syria and Honduras.
+ * Add watch file.
Modified: tzdata/trunk/debian/control
===================================================================
--- tzdata/trunk/debian/control 2007-04-13 10:52:31 UTC (rev 2053)
+++ tzdata/trunk/debian/control 2007-04-13 22:21:16 UTC (rev 2054)
@@ -1,15 +1,15 @@
Source: tzdata
Section: libs
-Essential: yes
Priority: required
Build-Depends: debhelper (>= 4.0.0)
-Build-Depends-Indep: quilt
+Build-Depends-Indep: quilt, po-debconf
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Uploaders: Ben Collins <bcollins@debian.org>, GOTO Masanori <gotom@debian.org>, Philip Blundell <pb@nexus.co.uk>, Jeff Bailey <jbailey@raspberryginger.com>, Daniel Jacobowitz <dan@debian.org>, Clint Adams <schizo@debian.org>, Aurelien Jarno <aurel32@debian.org>
Standards-Version: 3.7.2
Package: tzdata
Architecture: all
+Depends: debconf | debconf-2.0
Replaces: libc0.1, libc0.3, libc6, libc6.1
Description: Time Zone and Daylight Saving Time Data
This package contains data that represent the history of local time for many
Modified: tzdata/trunk/debian/postinst
===================================================================
--- tzdata/trunk/debian/postinst 2007-04-13 10:52:31 UTC (rev 2053)
+++ tzdata/trunk/debian/postinst 2007-04-13 22:21:16 UTC (rev 2054)
@@ -1,93 +1,32 @@
-#!/bin/bash
+#! /bin/sh
set -e
-export LC_ALL=C
-type=$1
-preversion=$2
+if [ "$1" = configure ]; then
+ . /usr/share/debconf/confmodule
+ db_version 2.0
-zone_banner() {
- TZBase=$(LC_ALL=C TZ=UTC0 date)
- UTdate=$(TZ=UTC0 date -d "$TZBase")
- TZdate=$(TZ="$timezone" date -d "$TZBase")
- extra_info="
-Local time is now: $TZdate.
-Universal Time is now: $UTdate."
- echo "Current default timezone: '$timezone'.$extra_info"
- echo "Run 'tzconfig' if you wish to change it."
-}
+ LC_ALL=C
+ AREA=Etc
+ ZONE=UTC
+ db_get tzdata/Areas && AREA="$RET"
+ db_get tzdata/Zones/$AREA && ZONE="$RET"
-set_timezone() {
- frontend=`echo "$DEBIAN_FRONTEND" | tr '[:upper:]' '[:lower:]'`
- if [ "$frontend" = noninteractive ]; then
- echo "Non-interactive mode, setting timezone to UTC. Run tzconfig to change."
- echo "UTC" >/etc/timezone
- ln -sf /usr/share/zoneinfo/UTC /etc/localtime
- else
- echo "Running 'tzconfig' to set this system's timezone."
- /usr/sbin/tzconfig
- fi
-}
+ umask 022
+ echo $AREA/$ZONE > /etc/timezone
+ rm -f /etc/localtime && \
+ cp -f /usr/share/zoneinfo/$AREA/$ZONE /etc/localtime
-realpath()
-{
- fname=${1%/} # strips trailing '/'
- while [ -L "$fname" ]; do
- oldfname="$fname"
- fname="$(command ls -l $fname)"
- fname="${fname#*\> }"
- if [ "$fname" = . ] ; then
- fname="$(dirname $oldfname)"
- elif echo $fname | grep -vq '^/' - ; then
- fname="$(dirname $oldfname)/$fname"
- fi
- done
- pushd $(dirname $fname) > /dev/null
- fname=$(pwd -P)/$(basename $fname)
- popd > /dev/null
- echo $fname
-}
-
-if [ "$type" = "configure" ]
-then
- if [ -f /etc/timezone ]; then
- timezone=$(head -n 1 /etc/timezone | sed -e "s/ .*//")
- else
- timezone=Factory
- fi
- if [ "$timezone" = Factory ]; then
- if [ -L /etc/localtime ]; then
- localtime_link=$(realpath /etc/localtime)
- if [ -f "$localtime_link" ]; then
- link_not_dangling=true
- fi
- if [ "$link_not_dangling" = true ]; then
- timezone=$(echo $localtime_link | sed 's%^/usr/share/zoneinfo/%%')
- fi
- fi
- fi
- if [ -f /usr/share/zoneinfo/$timezone ] && [ "$timezone" != Factory ]
- then
-# zic -l $timezone
- rm -f /etc/localtime && \
- cp -f /usr/share/zoneinfo/$timezone /etc/localtime
- zone_banner
- # Handle problem caused by lame old tzconfig.
- elif [ "$timezone" = "US/Pacific-New" ]
- then
- echo "US/Pacific" > /etc/timezone
-# zic -l US/Pacific
- rm -f /etc/localtime && \
- cp -f /usr/share/zoneinfo/US/Pacific /etc/localtime
- zone_banner
- else
- set_timezone
- fi
- if [ "$(date +%Z)" = "/etc/localtime" ]; then
- set_timezone
- fi
+ TZBase=$(LC_ALL=C TZ=UTC0 date)
+ UTdate=$(TZ=UTC0 date -d "$TZBase")
+ TZdate=$(TZ="$AREA/$ZONE" date -d "$TZBase")
+ echo
+ echo "Current default timezone: '$AREA/$ZONE'"
+ echo "Local time is now: $TZdate."
+ echo "Universal Time is now: $UTdate."
+ echo "Run 'dpkg-reconfigure tzdata' if you wish to change it."
+ echo
fi
-
#DEBHELPER#
exit 0
Modified: tzdata/trunk/debian/rules
===================================================================
--- tzdata/trunk/debian/rules 2007-04-13 10:52:31 UTC (rev 2053)
+++ tzdata/trunk/debian/rules 2007-04-13 22:21:16 UTC (rev 2054)
@@ -21,6 +21,20 @@
backward \
systemv
+TEMPLATES_FILE := $(CURDIR)/debian/templates
+TEMPLATES_AREAS := Africa \
+ America \
+ Antarctica \
+ Asia \
+ Atlantic \
+ Canada \
+ Europe \
+ Indian \
+ Pacific \
+ US \
+ SystemV \
+ Etc
+
QUILT := quilt --quiltrc ../debian/patches/quiltrc
build: build-stamp
@@ -56,6 +70,28 @@
# Generate a posixrules file
/usr/sbin/zic -d $(TZGEN) -p America/New_York
+
+ # Generate the templates file
+ ( echo "Template: tzdata/Areas" ; \
+ echo "Type: select" ; \
+ echo -n "_Choices: " ; \
+ echo "$(TEMPLATES_AREAS)" | sed -e 's# #, #g' -e 's#, $$##' ; \
+ echo "_Description: Geographic area:" ; \
+ echo " Please select the geographic area in which you live, then you will" ; \
+ echo " be shown a list of cities which represent the time zone in which they" ; \
+ echo " are located." ; \
+ echo ; \
+ for i in $(TEMPLATES_AREAS) ; do \
+ echo "Template: tzdata/Zones/$$i" ; \
+ echo "Type: select" ; \
+ echo -n "_Choices: " ; \
+ cd $(CURDIR)/tzgen/$$i ; \
+ find . -maxdepth 1 -type f | sed -e 's#^\./##' | sort -n | tr '\n' ',' | sed -e 's#,#, #g' -e 's#, $$#\n#' ; \
+ echo "_Description: Time zone:" ; \
+ echo " Please select the time zone corresponding to your location." ; \
+ echo ; \
+ done ) > $(TEMPLATES_FILE)
+ debconf-updatepo
touch $@
@@ -81,6 +117,7 @@
binary-indep: build install
dh_testdir
dh_testroot
+ dh_installdebconf
dh_installdirs
dh_install
dh_installchangelogs
Reply to: