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

Bug#510908: preseeding tzdata fails



On Mon, May 16, 2011 at 05:06:49PM +0200, Daniel Baumann wrote:
> retitle 510908 tzdata doesn't respect debconf preseeding
> tag 510908 patch
> thanks
> 
> On 05/16/2011 04:49 PM, Aurelien Jarno wrote:
> > tzdata should use data from debconf if neither /etc/localtime nor
> > /etc/timezone, otherwise it should default to the value read from these
> > files.
> 
> exactely; the problem here is that tzdata in config, if neither
> /etc/timezone nor /etc/localtime is present, and debconf values are
> stored in the db, then tzdata does *not* generate /etc/timezone from the
> values of debconf.
> 
> attached is a patch that fixed that.
> 
> Regards,
> Daniel
> 
> -- 
> Address:        Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern
> Email:          daniel.baumann@progress-technologies.net
> Internet:       http://people.progress-technologies.net/~daniel.baumann/

> From 3bcceafec00aa0a6485b1a80f79a57602fa01b49 Mon Sep 17 00:00:00 2001
> From: Daniel Baumann <daniel.baumann@progress-linux.org>
> Date: Mon, 16 May 2011 16:35:13 +0200
> Subject: [PATCH] Correcting debconf config script to respect preseeding of
>  tzdata (Closes: #510908).
> 
> ---
>  debian/config |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/debian/config b/debian/config
> index 4a00f9c..a910e0f 100644
> --- a/debian/config
> +++ b/debian/config
> @@ -356,11 +356,14 @@ if [ -e /etc/timezone ] && [ -e /etc/localtime ] ; then
>      fi
>  # The timezone has never been configured or is falsely configured
>  elif ! [ -e /etc/localtime ] || [ -n "$DEBCONF_RECONFIGURE" ] ; then
> -    if [ -z "$AREA" ] || [ -z "$ZONE" ] ; then
> -        AREA="Etc"
> -        ZONE="UTC"
> -        echo "Etc/UTC" > /etc/timezone
> -    fi

Why removing the if there? It means that if the timezone is
half-configured (ie /etc/localtime doesn't exist, but a timezone has
been determined from /etc/timezone), the debconf data is used instead.
It seems wrong, in that case the data from /etc/timezone should be used.

> +    AREA="Etc"
> +    ZONE="UTC" 
> +
> +    db_get tzdata/Areas && AREA="$RET"
> +    db_get tzdata/Zones/$AREA && ZONE="$RET"
> +
> +    echo "$AREA/$ZONE" > /etc/timezone
> +
>      db_fset tzdata/Areas seen false
>      db_fset tzdata/Zones/$AREA seen false
>  # The user want to handle the timezone by him/herself


-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net



Reply to: