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

Problems with --force-overwrite being default



Hi,

the debian-amd64 port had a major problem (breaks the ld, meaning
everything) caused partially by dpkgs:

dpkg (1.9.21) unstable; urgency=low

  * Enable --force-overwrite by default in /etc/dpkg/dpkg.cfg

I think that default is too dangerous. At least in the case of
"Replaces" there should be no overwriting by the replaced (not the
replacing) package by default. This can cause files to be lost.

Why? Read on.


Normaly debs don't contain the same file without conflicting. But when
a file is moved from one package to another the problem appears during
updates or on partial updates. To tell dpkg that a file is moved a
"Replaces" entry can be added to the control file.

With --force-overwrite enabled the moving file can disapear altogether
under some circumstances. Here is how you can reproduce it:

foo-1.0 has file 'baz'
foo-1.1 has file 'baz'
foo-1.2 doesn't

bar-1.0 doesn't
bar-1.1 has file 'baz'
        Replaces: foo (<< 1.1)

apt-get install foo=1.0  -> baz is owned by foo 
apt-get install bar=1.1  -> baz is owned by bar
apt-get install foo=1.1  -> baz is owned by foo, no error due to --force
apt-get install foo=1.2  -> baz is removed


The only way to prevent this from hapening is

bar-1.1 Conflicts: foo (<< 1.1)


So why isn't that enough?

The amd64 case is a bit more complex than this:

base-files-1.0-pure64 has /lib64 -> lib (required for everything to work)
libc6-1.0             has /lib/ld-linux-x86-64.so.2

base-files-1.1-pure64 has /lib64 (error on my part)
                      Pre-Depends: libc6 (>= 1.0-pure64)
libc6-1.0-pure64      has /lib64 -> lib and /lib/ld-linux-x86-64.so.2
                      Replaces: base-files (<< 1.1-pure64)

Because base-files must Pre-Depend on libc6 (otherwise the /lib64 link
is lost) the libc6 can neither Conflict not Depend on base-files.

To fix the error I uploaded:

base-files-1.2-pure64 has no /lib64
                      Pre-Depends: libc6 (>= 1.0-pure64)


People with the faulty base-files-1.1-pure64 installed, because they
have the default dpkg.cfg with --force-overwrite, loose /lib64 on
updates. And there doesn't seem to be anything I can do with
the base-files package to prevent that.

People without the default dpkg.cfg couldn't install the broken
base-files, because it was broken, and have no problem at all.

MfG
        Goswin



Reply to: