Debian Bug report logs - #595112
dpkg-maintscript-helper: new helper for moving a conffile between packages

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg.

Reported by: Josh Triplett <josh@joshtriplett.org>

Date: Wed, 1 Sep 2010 06:57:02 UTC

Severity: wishlist

Merged with 672945

Found in version dpkg/1.15.8.4

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, josh@joshtriplett.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Wed, 01 Sep 2010 06:57:05 GMT) Full text and rfc822 format available.

Message #3 received at submit@bugs.debian.org (full text, mbox):

From: Josh Triplett <josh@joshtriplett.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Tue, 31 Aug 2010 23:56:17 -0700
Package: dpkg
Version: 1.15.8.4
Severity: wishlist
File: /usr/bin/dpkg-maintscript-helper

Moving a conffile from one package to another seems to prove even more
difficult than renaming it or removing it.  Please consider providing
support for this case in dpkg-maintscript-helper.

Thanks,
Josh Triplett

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages dpkg depends on:
ii  coreutils         8.5-1                  GNU core utilities
ii  libbz2-1.0        1.0.5-4                high-quality block-sorting file co
ii  libc6             2.11.2-2               Embedded GNU C Library: Shared lib
ii  libselinux1       2.0.96-1               SELinux runtime shared libraries
ii  xz-utils          4.999.9beta+20100810-1 XZ-format compression utilities
ii  zlib1g            1:1.2.3.4.dfsg-3       compression library - runtime

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                           0.8.0      Advanced front-end for dpkg

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Fri, 13 Jul 2012 15:27:50 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 13 Jul 2012 15:27:54 GMT) Full text and rfc822 format available.

Message #8 received at 595112@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Josh Triplett <josh@joshtriplett.org>, 595112@bugs.debian.org
Cc: Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Fri, 13 Jul 2012 17:26:28 +0200
retitle 595112 dpkg-maintscript-helper: new helper for moving a conffile between packages
thanks

On Tue, 31 Aug 2010, Josh Triplett wrote:
> Moving a conffile from one package to another seems to prove even more
> difficult than renaming it or removing it.  Please consider providing
> support for this case in dpkg-maintscript-helper.

What kind of problems are you referring to?

Michael Biebl reported in the thread at
http://lists.debian.org/4F31C323.9090606@debian.org
that the difficulty was to handle the case where the target
package has no guaranty to be installed. In that case, we
might keep the old conffile around when we don't really
want.

In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
I suggested to create a rm_conffile_if_owner helper
function to deal with this case.

Would this fit your needs too?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/




Changed Bug title to 'dpkg-maintscript-helper: new helper for moving a conffile between packages' from '/usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages' Request was from Raphael Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Fri, 13 Jul 2012 15:28:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Fri, 13 Jul 2012 19:36:36 GMT) Full text and rfc822 format available.

Acknowledgement sent to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Fri, 13 Jul 2012 19:36:36 GMT) Full text and rfc822 format available.

Message #15 received at 595112@bugs.debian.org (full text, mbox):

From: Josh Triplett <josh@joshtriplett.org>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 595112@bugs.debian.org, Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Fri, 13 Jul 2012 11:50:14 -0700
On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> retitle 595112 dpkg-maintscript-helper: new helper for moving a conffile between packages
> thanks
> 
> On Tue, 31 Aug 2010, Josh Triplett wrote:
> > Moving a conffile from one package to another seems to prove even more
> > difficult than renaming it or removing it.  Please consider providing
> > support for this case in dpkg-maintscript-helper.
> 
> What kind of problems are you referring to?
> 
> Michael Biebl reported in the thread at
> http://lists.debian.org/4F31C323.9090606@debian.org
> that the difficulty was to handle the case where the target
> package has no guaranty to be installed. In that case, we
> might keep the old conffile around when we don't really
> want.
> 
> In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> I suggested to create a rm_conffile_if_owner helper
> function to deal with this case.
> 
> Would this fit your needs too?

I *think* that would work.  I don't need support for moving conffiles
between arbitrary packages, just support for allowing package2 to take
over a conffile from package1, and allowing package1 to drop the
conffile if not installing package2.  How would rm_conffile_if_owner
behave with a modified conffile?  Would it keep the conffile around in a
way that allows the new package to take it over with the old contents
still intact?  And, would this also ensure that the conffile (even if
modified) gets removed when purging package1, if not yet taken over by
package2?

- Josh Triplett




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Tue, 31 Jul 2012 15:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 31 Jul 2012 15:33:03 GMT) Full text and rfc822 format available.

Message #20 received at 595112@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Josh Triplett <josh@joshtriplett.org>
Cc: 595112@bugs.debian.org, Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Tue, 31 Jul 2012 17:21:38 +0200
Hi,

On Fri, 13 Jul 2012, Josh Triplett wrote:
> On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> > Michael Biebl reported in the thread at
> > http://lists.debian.org/4F31C323.9090606@debian.org
> > that the difficulty was to handle the case where the target
> > package has no guaranty to be installed. In that case, we
> > might keep the old conffile around when we don't really
> > want.
> > 
> > In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> > I suggested to create a rm_conffile_if_owner helper
> > function to deal with this case.
> > 
> > Would this fit your needs too?
> 
> I *think* that would work.  I don't need support for moving conffiles
> between arbitrary packages, just support for allowing package2 to take
> over a conffile from package1, and allowing package1 to drop the
> conffile if not installing package2.  How would rm_conffile_if_owner
> behave with a modified conffile?

Just like rm_conffile. It would keep a ".dpkg-bak" copy of the file.

> Would it keep the conffile around in a way that allows the new package
> to take it over with the old contents still intact?

Hum, not sure. At least I was not intending it that way. I was rather
imagining that the dependencies would force the upgrade of the target
package at the same time. That is package1 would break the versions of
package2 that don't have the conffile.

That way, in package1's postinst we can be sure that:
- either package2 has taken the file over
- or package2 is not installed

> And, would this also ensure that the conffile (even if modified) gets
> removed when purging package1, if not yet taken over by package2?

Yes, that should be part of the contract of rm_conffile_if_owner. But
it will only have to deal with this in the case of a modified conffile
(since the non-modified conffile would be pruned before-hand in the
postinst).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Tue, 31 Jul 2012 16:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 31 Jul 2012 16:00:02 GMT) Full text and rfc822 format available.

Message #25 received at 595112@bugs.debian.org (full text, mbox):

From: Josh Triplett <josh@joshtriplett.org>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 595112@bugs.debian.org, Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Tue, 31 Jul 2012 08:55:43 -0700
On Tue, Jul 31, 2012 at 05:21:38PM +0200, Raphael Hertzog wrote:
> On Fri, 13 Jul 2012, Josh Triplett wrote:
> > On Fri, Jul 13, 2012 at 05:26:28PM +0200, Raphael Hertzog wrote:
> > > Michael Biebl reported in the thread at
> > > http://lists.debian.org/4F31C323.9090606@debian.org
> > > that the difficulty was to handle the case where the target
> > > package has no guaranty to be installed. In that case, we
> > > might keep the old conffile around when we don't really
> > > want.
> > > 
> > > In http://lists.debian.org/20120209095814.GA3452@rivendell.home.ouaza.com
> > > I suggested to create a rm_conffile_if_owner helper
> > > function to deal with this case.
> > > 
> > > Would this fit your needs too?
> > 
> > I *think* that would work.  I don't need support for moving conffiles
> > between arbitrary packages, just support for allowing package2 to take
> > over a conffile from package1, and allowing package1 to drop the
> > conffile if not installing package2.  How would rm_conffile_if_owner
> > behave with a modified conffile?
> 
> Just like rm_conffile. It would keep a ".dpkg-bak" copy of the file.
> 
> > Would it keep the conffile around in a way that allows the new package
> > to take it over with the old contents still intact?
> 
> Hum, not sure. At least I was not intending it that way. I was rather
> imagining that the dependencies would force the upgrade of the target
> package at the same time. That is package1 would break the versions of
> package2 that don't have the conffile.
> 
> That way, in package1's postinst we can be sure that:
> - either package2 has taken the file over
> - or package2 is not installed

Consider the original motivation for this.  You have a package A, which
contains a daemon B and an init script /etc/init.d/B.  You split B and
its init script (and any other configuration files for it) into its own
package, which A does not depend on.  If installing B, you want to
preserve the configuration of B.  B didn't exist beforehand, so no
package exists for A to declare a Breaks against.  However, nothing
guarantees that the user will install B at the same time as upgrading A.
In particular, it seems highly likely that a user who wants B will
upgrade A, read the NEWS.Debian file, and then choose whether to install
B.

- Josh Triplett



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Tue, 31 Jul 2012 18:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Raphael Hertzog <hertzog@debian.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Tue, 31 Jul 2012 18:51:06 GMT) Full text and rfc822 format available.

Message #30 received at 595112@bugs.debian.org (full text, mbox):

From: Raphael Hertzog <hertzog@debian.org>
To: Josh Triplett <josh@joshtriplett.org>
Cc: 595112@bugs.debian.org, Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Tue, 31 Jul 2012 20:47:06 +0200
On Tue, 31 Jul 2012, Josh Triplett wrote:
> Consider the original motivation for this.  You have a package A, which
> contains a daemon B and an init script /etc/init.d/B.  You split B and
> its init script (and any other configuration files for it) into its own
> package, which A does not depend on.  If installing B, you want to
> preserve the configuration of B.  B didn't exist beforehand, so no
> package exists for A to declare a Breaks against.  However, nothing
> guarantees that the user will install B at the same time as upgrading A.
> In particular, it seems highly likely that a user who wants B will
> upgrade A, read the NEWS.Debian file, and then choose whether to install
> B.

OK so we really need a "recover_conffile" which would be used in
package2 and would move a .dpkg-bak copy in its original place.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Get the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/



Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#595112; Package dpkg. (Thu, 02 Aug 2012 07:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Josh Triplett <josh@joshtriplett.org>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (Thu, 02 Aug 2012 07:51:06 GMT) Full text and rfc822 format available.

Message #35 received at 595112@bugs.debian.org (full text, mbox):

From: Josh Triplett <josh@joshtriplett.org>
To: Raphael Hertzog <hertzog@debian.org>
Cc: 595112@bugs.debian.org, Michael Biebl <biebl@debian.org>
Subject: Re: Bug#595112: /usr/bin/dpkg-maintscript-helper: Please provide helper for moving a conffile between packages
Date: Thu, 2 Aug 2012 00:46:58 -0700
On Tue, Jul 31, 2012 at 08:47:06PM +0200, Raphael Hertzog wrote:
> On Tue, 31 Jul 2012, Josh Triplett wrote:
> > Consider the original motivation for this.  You have a package A, which
> > contains a daemon B and an init script /etc/init.d/B.  You split B and
> > its init script (and any other configuration files for it) into its own
> > package, which A does not depend on.  If installing B, you want to
> > preserve the configuration of B.  B didn't exist beforehand, so no
> > package exists for A to declare a Breaks against.  However, nothing
> > guarantees that the user will install B at the same time as upgrading A.
> > In particular, it seems highly likely that a user who wants B will
> > upgrade A, read the NEWS.Debian file, and then choose whether to install
> > B.
> 
> OK so we really need a "recover_conffile" which would be used in
> package2 and would move a .dpkg-bak copy in its original place.

That sounds perfect.  Package A would use rm_conffile, which would move
a modified conffile to .dpkg-bak; package B would ship a default
configuration file, and use recover_conffile, which would move the
.dpkg-bak file over the top of the default configuration file if it
exists.

- Josh Triplett



Merged 595112 672945 Request was from Raphaël Hertzog <hertzog@debian.org> to control@bugs.debian.org. (Wed, 05 Sep 2012 14:12:08 GMT) Full text and rfc822 format available.

Added indication that bug 595112 blocks 689780 Request was from Mark Purcell <msp@debian.org> to control@bugs.debian.org. (Sat, 20 Oct 2012 01:09:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Apr 16 11:34:21 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.