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

Re: Transferring conffiles between packages (Re: Bug#564254: conflicting /etc/bash_completion)



Hi!

On Tue, 2010-11-02 at 15:14:36 -0500, Jonathan Nieder wrote:
> On 2010-01-08, Kurt Roeckx wrote:
> > I got this on the buildd:
> > Unpacking bash-completion (from .../bash-completion_1%3a1.1-3_all.deb) ...
> > dpkg: error processing /home/buildd/build/chroot-unstable/var/cache/apt/archives/bash-completion_1%3a1.1-3_all.deb
> > (--unpack): trying to overwrite `/etc/bash_completion', which is also in package bash
> > 
> > On the system:
> > excelsior:~# ls -l /etc/bash_completion
> > -rw-r--r-- 1 root root 215907 Jul  5  2006 /etc/bash_completion
> > excelsior:~# dpkg --search /etc/bash_completion
> > bash: /etc/bash_completion
> > 
> > This is with bash 4.0-7.
> 
> The message is in tarobject().  I think dpkg 1.13.14~19 (Improve
> processing of disappearing conffiles, 2006-02-10) was supposed to deal
> with this case:
> 
>    If the file to be unpacked is (1) a conffile in the new package and
>    (2) a regular file rather than a symlink or directory, and some
>    installed conffile with the same inode is obsolete, then let the
>    installation continue.

Right. I fixed few bugs from that patch, but not related to this:

  4021e3db0f30bf4a19abb2a54fe5758654baa4e3
  368b3934bbf1d106e8448b8587657292c24da777

> Checking on snapshot.debian.org, I see that /etc/bash_completion was
> indeed a conffile in bash-completion 1:1.1-3.

> Kurt Roeckx wrote:
> 
> > At some point in time the chroot had the version from oldstable
> > or older, just like all my chroots and main systems.  And I have
> > upgraded from that version.  I never installed bash-completion.
> > But now some pacakge build-depends on that for some strange reason,
> > and I get that error.

> Any idea what could have gone wrong?

My guess would be that bash got upgraded to the package w/o the
obsolete conffile before the fixed dpkg on those systems.

A proof of that I guess, might be checking if the file has the obsolete
flag, if it does not then it was installed by a buggy dpkg.

  $ dpkg-query -W -f '${Conffiles}\n' bash | grep bash_completion

And an unversioned Replaces in bash-completion would be the correct way
to handle that. Fixing that in bash would imply removing the file on
upgrade, removing it on remove or purge would not really happen (bash
is Essential). And as such it would need to check if bash-completion is
installed, to not remove a file it does not own, or check if it has the
conffile listed in the Conffile field w/o the obsolete flag? etc, which
seems overcomplex and just wrong, compared with just a Replaces field.

regards,
guillem


Reply to: