Re: Bug#800769: pbuilder: conffiles not removed

2015-10-13 Thread Wouter Verhelst
On Sun, Oct 11, 2015 at 03:49:31PM +, Mattia Rizzolo wrote:
> On Sun, Oct 11, 2015 at 11:03:09AM +0200, Wouter Verhelst wrote:
> > The only way to hand a file (any file) over to another package is by way of
> > 'Replaces:', *without* the Conflicts: and Provides:.
> > 
> > Since this is a single packaga version, you could put the file in 
> > pbuilder-uml
> > and have that 'Replaces: pbuilder (= 0.217)', that way the possible damage 
> > in
> > case you have other (accidental) file conflicts would be limited.
> 
> Though this way if a person install pbuilder 0.217, then removes it the
> conffile would stay there, and that's the whole point of the bug.
> I agree the Replaces is needed, but I don't see it as being enough to
> deal with this... :(

So these are the possible interactions that I can think of:

- If it's removed without --purge, the conffile stays, true,
  but that's what the user asked for.
- If it's removed without --purge, and later pbuilder-uml is installed,
  the Replaces: header takes care of taking over the config file.
- If it's removed with --purge without installing pbuilder-uml, the
  conffile is still registered to pbuilder and will be removed along
  with the rest of the package.
- If it's removed with --purge after installing pbuilder-uml, the
  Replaces: header should ensure it won't be removed (though you might
  want to test that to be sure).
- New versions of pbuilder should check in their postinst (with
  dpkg-query) when they're upgrading from 0.217 or purging what the
  status of pbuilder-uml is. If it's installed or at config-files with a
  version that has the Replaces: header, then pbuilder should not touch
  it. If not, it should remove the file.

Did I miss any other use case?

-- 
It is easy to love a country that is famous for chocolate and beer

  -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26



Re: Bug#800769: pbuilder: conffiles not removed

2015-10-13 Thread Mattia Rizzolo
On Mon, Oct 12, 2015 at 06:13:40PM +0200, Vincent Bernat wrote:
>  ❦ 12 octobre 2015 17:45 +0200, Jakub Wilk  :
> > Another possibility is to refrain from fixing the bug, and let unlucky
> > users clean their systems themselves.
> 
> I think that's the best solution. All the more if the faulty package
> lived only a few days in unstable. All other tentatives would just
> trigger more problems.

I agree.

I wouldn't try removing the file, too hassle for imho not that big gain
(how many people installed it in < 24 hours it was in the archive?!?).

So if I don't get any other suggestion/comments I'd go adding a
'Replaces: pbuilder (=0.217)' to pbuilder-uml. and move on.

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  http://mapreri.org  : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Re: Bug#800769: pbuilder: conffiles not removed

2015-10-12 Thread Jakub Wilk

As I understand it, this is what happened:

src:pbuilder builds two binary packages: pbuilder and pbuilder-uml.
pbuilder-uml depends on pbuilder.
pbuilder suggests pbuilder-uml.

pbuilder-uml ships /etc/pbuilder/pbuilder-uml.conf.
pbuilder is of course not supposed to ship the same conffile.

Because of a latent bug in debian/rules, pbuilder_0.217 shipped multiple 
files that belonged to pbuilder-uml, including 
/etc/pbuilder/pbuilder-uml.conf. This is bug #800416, which was promptly 
fixed in pbuilder_0.218. The faulty package was only in unstable for 
about a day.


However, people who had the buggy package installed now have an obsolete 
conffile on their disks.


[If all the above had been written in the initial mail, and I hadn't had 
to dig through bugs.d.o and snapshot.d.o, I would have been so happy!]


* Mattia Rizzolo , 2015-10-10, 16:30:
That file is supposed to be only on pbuilder-uml binary, so I can't 
just use rm_conffiles to remove it in pbuilder, as that would blindly 
remove it while pbuilder-uml might be using it.


dpkg-maintscript-helper has some ownership checks implemented, but I'm 
afraid they might be insufficient.


It might be tempting to call d-m-h conditionally, only if pbuilder-uml 
is not installed, but it might be difficult to get it right in all 
corner cases. (Keep in mind that you call d-m-h multiple times, and the 
status of pbuilder-uml can change between the calls.)


I'd suggest to do something very simple instead:
In pbuilder's postinst, if pbuilder-uml status is not-installed, simply 
rm -f /etc/pbuilder/pbuilder-uml.conf.


(Note that dpkg will notice that the conffile is gone only on the 
NEXT pbuilder upgrade. I don't think this is a big deal, given that the 
bug affected only unstable users, who will most likely upgrade pbuilder 
many times in the near future anyway.)


Another possibility is to refrain from fixing the bug, and let unlucky 
users clean their systems themselves.


--
Jakub Wilk



Re: Bug#800769: pbuilder: conffiles not removed

2015-10-12 Thread Vincent Bernat
 ❦ 12 octobre 2015 17:45 +0200, Jakub Wilk  :

> I'd suggest to do something very simple instead:
> In pbuilder's postinst, if pbuilder-uml status is not-installed,
> simply rm -f /etc/pbuilder/pbuilder-uml.conf.

If for some reason, a user has put a file with this exact same name
here, it would be deleted. For example, Ulrich Matthias Lang could make
a copy of pbuilder.conf to pbuilder-uml.conf before doing a
modification. How would they know that a package they never installed
did contain the same path?

> Another possibility is to refrain from fixing the bug, and let unlucky
> users clean their systems themselves.

I think that's the best solution. All the more if the faulty package
lived only a few days in unstable. All other tentatives would just
trigger more problems.
-- 
Watch out for off-by-one errors.
- The Elements of Programming Style (Kernighan & Plauger)


signature.asc
Description: PGP signature


Re: Bug#800769: pbuilder: conffiles not removed

2015-10-12 Thread Sune Vuorela
On 2015-10-12, Jakub Wilk  wrote:
> Because of a latent bug in debian/rules, pbuilder_0.217 shipped multiple 
> files that belonged to pbuilder-uml, including 
> /etc/pbuilder/pbuilder-uml.conf. This is bug #800416, which was promptly 
> fixed in pbuilder_0.218. The faulty package was only in unstable for 
> about a day.

I'd say "tough luck" to both the people in unstable who will have an
obsolete configuration file that they need to fix up by hand.

/Sune



Re: Bug#800769: pbuilder: conffiles not removed

2015-10-11 Thread Wouter Verhelst
On Sat, Oct 10, 2015 at 04:30:28PM +, Mattia Rizzolo wrote:
> Hi fellows debian-devel@ lurkers!
> 
> On Sat, Oct 03, 2015 at 09:03:46PM +, Mattia Rizzolo wrote:
> > On Sat, Oct 03, 2015 at 02:33:09PM +0200, Paul Wise wrote:
> > > The recent upgrade did not deal with obsolete conffiles properly.
> > > Please use the dpkg-maintscript-helper support provided by dh_installdeb
> > > to remove these obsolete conffiles on upgrade.
> > > 
> > > https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files
> > > http://manpages.debian.org/man/1/dh_installdeb
> > > 
> > > $ pkg=pbuilder ; adequate $pkg ; dpkg-query -W -f='${Conffiles}\n' $pkg | 
> > > grep obsolete
> > > pbuilder: obsolete-conffile /etc/pbuilder/pbuilder-uml.conf
> > >  /etc/pbuilder/pbuilder-uml.conf ce1832f09d721efe29b92ec153fa4410 obsolete
> > 
> > oh, gosh
> > All this just for fucking up with the arch:all buildd :\
> > 
> > This happened because the 0.217 was the first version being built by the
> > arch:all autobuilder, but the code that moved that file away was run
> > only for arch-indep builds, so it did not run there; the 0.218 was
> > uploaded exactly to fix that issue, but 0.217 was already in the wild
> > with that bogus file.
> > 
> > That file is supposed to be only on pbuilder-uml binary, so I can't just
> > use rm_conffiles to remove it in pbuilder, as that would blindly remove
> > it while pbuilder-uml might be using it.
> > 
> > How do you suggest to handle this?
> 
> Do you happen to have ides?
> What actually needs to happen is to hand a conffile over to another
> package, but neither me or pabs have a clue on how to do that.

The only way to hand a file (any file) over to another package is by way of
'Replaces:', *without* the Conflicts: and Provides:.

Since this is a single packaga version, you could put the file in pbuilder-uml
and have that 'Replaces: pbuilder (= 0.217)', that way the possible damage in
case you have other (accidental) file conflicts would be limited.

-- 
It is easy to love a country that is famous for chocolate and beer

  -- Barack Obama, speaking in Brussels, Belgium, 2014-03-26



Re: Bug#800769: pbuilder: conffiles not removed

2015-10-11 Thread Mattia Rizzolo
On Sun, Oct 11, 2015 at 11:03:09AM +0200, Wouter Verhelst wrote:
> The only way to hand a file (any file) over to another package is by way of
> 'Replaces:', *without* the Conflicts: and Provides:.
> 
> Since this is a single packaga version, you could put the file in pbuilder-uml
> and have that 'Replaces: pbuilder (= 0.217)', that way the possible damage in
> case you have other (accidental) file conflicts would be limited.

Though this way if a person install pbuilder 0.217, then removes it the
conffile would stay there, and that's the whole point of the bug.
I agree the Replaces is needed, but I don't see it as being enough to
deal with this... :(

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  http://mapreri.org  : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature


Re: Bug#800769: pbuilder: conffiles not removed

2015-10-10 Thread Mattia Rizzolo
Hi fellows debian-devel@ lurkers!

On Sat, Oct 03, 2015 at 09:03:46PM +, Mattia Rizzolo wrote:
> On Sat, Oct 03, 2015 at 02:33:09PM +0200, Paul Wise wrote:
> > The recent upgrade did not deal with obsolete conffiles properly.
> > Please use the dpkg-maintscript-helper support provided by dh_installdeb
> > to remove these obsolete conffiles on upgrade.
> > 
> > https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files
> > http://manpages.debian.org/man/1/dh_installdeb
> > 
> > $ pkg=pbuilder ; adequate $pkg ; dpkg-query -W -f='${Conffiles}\n' $pkg | 
> > grep obsolete
> > pbuilder: obsolete-conffile /etc/pbuilder/pbuilder-uml.conf
> >  /etc/pbuilder/pbuilder-uml.conf ce1832f09d721efe29b92ec153fa4410 obsolete
> 
> oh, gosh
> All this just for fucking up with the arch:all buildd :\
> 
> This happened because the 0.217 was the first version being built by the
> arch:all autobuilder, but the code that moved that file away was run
> only for arch-indep builds, so it did not run there; the 0.218 was
> uploaded exactly to fix that issue, but 0.217 was already in the wild
> with that bogus file.
> 
> That file is supposed to be only on pbuilder-uml binary, so I can't just
> use rm_conffiles to remove it in pbuilder, as that would blindly remove
> it while pbuilder-uml might be using it.
> 
> How do you suggest to handle this?

Do you happen to have ides?
What actually needs to happen is to hand a conffile over to another
package, but neither me or pabs have a clue on how to do that.

Suggestion welcome!

-- 
regards,
Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540  .''`.
more about me:  http://mapreri.org  : :'  :
Launchpad user: https://launchpad.net/~mapreri  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-


signature.asc
Description: PGP signature