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

Bug#2831: timezone conffiles vs. postinst




On Wed, 1 May 1996, Guy Maor wrote:

> On Wed, 1 May 1996, Fernando wrote:
>
> > On Tue, 30 Apr 1996, Bruce Perens wrote:
> >
> > > The problem happens when you go to upgrade the timezone package. If I
> > > say "Y" to the control file prompt, the package will replace my
> > > _configured_ /etc/timezone with the one for Factory. Since you create
> >
> > 1) If I am not wrong, the prompt will appear only if the configuration
> > file that _I_ provide changes, but I don't think I will ever have to
> > change it. So you should never see that prompt.
>
> Actually you are wrong.  Simply, there are 3 versions of any config
> file when its containing package is being upgraded:
>
> 	1) the original one in the previous package
> 	2) the one installed right now
> 	3) the original one in the new package.
>
> You'll get the prompt if 1 and 2 are different, *not* if 1 and 3 are
> different.  So the user will get the prompt every time he updates your
> timezone library.  Actually she should never get the prompt.  The way
> to do this is, as Bruce suggested, is to manage the file solely from the
> postinst, and never put it in the .deb file.
>
>From the Guidelines:

*   One option is for you to ship a minimal `best-effort' file in
* `/etc', and list the file in `conffiles'.  This will mean that the user
* will have to go and edit the file themselves to get the package to work
* properly, of course.  The next time they upgrade the package, if you
* haven't changed the file version, their old file will be left in place.
* If you have modified your version then the user will get a prompt
* asking them which version of the file they want, theirs or yours.  They
* will then usually have to resolve the discrepancies manually.


This clearly explains that the prompt is shown if 1 and 3 *are* different.
Maybe the Guidelines are wrong, but I don't think so. It is more
reasonable than what you suggest, and it is what actually happens.


> Most of your other criticisms are moot in light of the above.
>
> > I am afraid I don't agree with you. I want it to be a conffile. That way,
> > you can remove the timezone package (not purge!) and the time zone will
> > still be correct.
>
> Actually that's not true either.  Read tzset(3) and you'll see that the
> contents of /usr/lib/zoneinfo/localtime are what's important.
>

Please read the following paragraph included in the doc that I wrote as an
introduction for the timezone package. You should have it installed as
/usr/doc/timezone/Introduction.gz:

* The script /usr/sbin/tzconfig asks you for the time zone and writes it to
* /etc/timezone. Then it creates a link so that /etc/localtime points to
* the right file in /usr/lib/zoneinfo. Basically this will be
* /usr/lib/zoneinfo/`cat /etc/timezone`. Then it checks that the file
* /usr/lib/zoneinfo/localtime is a link to /etc/localtime. The reason is that
* the unix library looks for the file /usr/lib/zoneinfo/localtime. But /usr
* could be mounted read-only. We don't want to modify files in /usr, so
* we let the referenced file to be just a link to one in /etc, which is
* where all configuration files reside. We could make the unix library to
* look directly for /etc/localtime instead, but then our libc would have
* to be customized. We might explore this possibility in the future.

And if you take a look at my postrm script, you will see that when the
package is removed the file /usr/lib/zoneinfo/localtime is converted to a
real file. But since /etc/timezone is a conf file we can recreate the
above layout again when a new timezone package is installed.


I think I am right in both issues.

Regards,
	Fernando.


Reply to: