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

Bug#578852: prohibit usage of Breaks for file conflicts



Guillem Jover <guillem@debian.org> writes:

> Hi!
>
> On Fri, 2010-04-23 at 10:51:56 +0200, Goswin von Brederlow wrote:
>> Package: debian-policy
>> Version: 3.8.4.0
>> Severity: normal
>
>> to test the actual behaviour of dpkg for this situation I created the
>> following 5 packages:
> [...]
>
>> In conclusion:
>> ==============
>> 
>> On downgrades using Replaces with Breaks triggers a long standing dpkg
>> bug or can cause files to disapear. So it might indeed be wise for
>> policy to prohibit the use of Breaks for file conflicts. Even if the
>> dpkg bug is fixed it still risks loosing files when reverting a
>> partial upgrade and downgrading to the old versions.
>
> There's the problem with downgrades and versioned Replaces, and there's
> the other problem with disappearing the wrong replaced/replacing package
> on reverse installation order and losing track of package ownership of
> files, fixed also in 1.15.7 with:
>
>   <http://git.debian.org/?p=dpkg/dpkg.git;a=commit;h=0958a9f9>
>
> Neither of these are triggered by Breaks nor Conflicts.
>
> These test-cases can be found in:
>
>   <http://git.debian.org/?p=dpkg/pkg-tests.git;a=tree>
>
> regards,
> guillem

% dpkg --version
Debian `dpkg' package management program version 1.15.7.1 (amd64).
This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.

% dpkg -S /usr/share/doc/foo/foo.control  
foo: /usr/share/doc/foo/foo.control

% sudo dpkg --auto-deconfigure --unpack bar_2_all.deb 
dpkg: considering deconfiguration of foo, which would be broken by
installation of bar ...
dpkg: yes, will deconfigure foo (broken by bar).
(Reading database ... 176362 files and directories currently installed.)
Preparing to replace bar 1 (using bar_2_all.deb) ...
De-configuring foo ...
Unpacking replacement bar ...
Replacing files in old package foo ...

% dpkg -S /usr/share/doc/foo/foo.control   
bar: /usr/share/doc/foo/foo.control

% sudo dpkg -i bar_1_all.deb 
(Reading database ... 176362 files and directories currently installed.)
Preparing to replace bar 2 (using bar_1_all.deb) ...
Unpacking replacement bar ...
Setting up bar (1) ...

% sudo dpkg --configure -a
Setting up foo (1) ...

% dpkg -S /usr/share/doc/foo/foo.control   
dpkg: /usr/share/doc/foo/foo.control not found.


With Replaces files disapear on downgrade unless the replaced package is
also reinstalled (after the downgrade). As long as dpkg does not keep a
backup of replaced files and restores them on downgrades that can not be
fixed. This is not really a bug as I think that is just how Replaces is
specified. Replaces just isn't a reversible (downgradable) feature.

MfG
        Goswin



Reply to: