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

Re: /etc/ question



On Sun, 25 Feb 2001, Julian Gilbey wrote:
> On Fri, Feb 23, 2001 at 03:57:33PM -0800, Sean 'Shaleh' Perry wrote:
> > in your preinst, check for /etc/foo and if it exists, mkdir /etc/package and
> 
> Perhaps better: copy it in the postinst, remove the old version in the
> postinst.  Then if any problems arise, the original version will still
> be present.

BAD idea. This will defeat the conffile change detection engine in dpkg, and
will cause problems in some cases. Don't do that.

In the *pre*inst, mv old -> new IFF old exists and new does NOT exist
In the posinst, just use the new location.

Remember to correctly unwind, moving the conffile back to its original place
(as long as the original file does not exist) in the abort-install and
abort-upgrade targets of preinst, postrm and postinst. [never tried this,
but that seems to be what's needed from the not-so-clear policy chapter 6]

> If you are really careful, you should also move them back if the
> package is being downgraded to a pre-move version.  Check policy to
> see how the maintainer scripts are run.

Yes, that might be a good idea. However, as a rule of thumb, downgrading is
not supported (do note that failed/aborted upgrades ARE supported).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Attachment: pgppI3NHQ2Ko5.pgp
Description: PGP signature


Reply to: