This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: best practice for upgrading config files?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Schulman wrote:
> I'm packaging a new release of lftp.  The default config file
> (/etc/lftp.conf) is slightly different from the one in the previous release.
> This raises a problem:  how should I determine whether to replace the old
> config file?  There are at least three approaches, in increasing order of
> complexity:
> 
> (1) Copy the new default config in only if none already exists:
> 
> [ -e /etc/lftp.conf ] || cp /etc/defaults/etc/lftp.conf /etc

I think this is common current practice.

> (2) Ask the user what they want to do

You can't really do this, since our postinstall scripts have no facility
for user interaction.

> (3) Compute a checksum of the current /etc/lftp.conf, and compare it to the
> checksum of the old default.  If they're the same, then the user hasn't
> touched the old default so copy the new default in.  If they're different,
> then prompt the user as in (2).  So we need to store checksums of default
> config files somewhere.  This is Debian's method.  Again if this is the
> preferred method, then someone should develop a standard method to handle
> it.

Debian has a package called ucf which provides this kind of service to
maintainer scripts. I imagine we could adopt it too, if we wanted.

Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFEYQJtfFNSmcDyxYARAhggAJ91yiDJ9fG8HJZ2+ZMD0OnFHNUcdACcCCB1
xcL0n/LhSfpHM2ddjou2iRw=
=Ja0Q
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]