#217862 dpkg: check rdepends on unpack

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
"Nikita V. Youshchenko"
Date:
2010-05-06 13:33:07 UTC
Severity:
important
#217862#5
Date:
2003-10-27 20:35:40 UTC
From:
To:
This bug may be easilly reproduced.
Create dummy package p1, version 1, and dummy package p2, version 1,
that Depends: p1 (= 1).
Install both.
Now create package p2, version 2, and try to install it with dpkg -i,
without any --force.
Dpkg will silently do it, breaking the dependency for package p2.

This does cause system breakages if packages are installed without apt
(which is useful sometimes).
E.g. if libfoo-dev does need exact version of libfoo ...

#217862#10
Date:
2003-10-28 00:43:10 UTC
From:
To:
Either your example is backwards, or you haven't demonstrated any bug.
Changing the version number of p2 does not break any dependencies in this
scenario.

#217862#15
Date:
2003-10-28 05:03:10 UTC
From:
To:
Sorry. I mean p1 of course.
#217862#20
Date:
2003-10-28 05:21:20 UTC
From:
To:
The following command sequence demonstrates the bug.
I first install p2 then p1 only to ensure that dependency is there.
Dpkg leaves it unconfigured, so I install p2 anf then configure p1.
Then I upgrade p1, and dpkg silently does it, breaking the dependency for
p2.
Then I run apt-get install -f, just to show that dependency becomes
treally broken, and apt notices that.

nikita@sercond:/tmp/bug> mkdir p1_1 p1_2 p2
nikita@sercond:/tmp/bug> echo p1 > p1_1/p1
nikita@sercond:/tmp/bug> echo p1 > p1_2/p1
nikita@sercond:/tmp/bug> echo p2 > p2/p2
nikita@sercond:/tmp/bug> mkdir p1_1/DEBIAN
nikita@sercond:/tmp/bug> mkdir p1_2/DEBIAN
nikita@sercond:/tmp/bug> mkdir p2/DEBIAN
nikita@sercond:/tmp/bug> cat > p1_1/DEBIAN/control
Package: p1
Version: 1
Maintainer: nobody@nobody.org
Description: test package p1
Architecture: all

nikita@sercond:/tmp/bug> dpkg -b p1_1 p1_1.deb
dpkg-deb: building package `p1' in `p1_1.deb'.

nikita@sercond:/tmp/bug> cat > p1_2/DEBIAN/control
Package: p1
Version: 2
Maintainer: nobody@nobody.org
Description: test package p1
Architecture: all

nikita@sercond:/tmp/bug> dpkg -b p1_2 p1_2.deb
dpkg-deb: building package `p1' in `p1_2.deb'.

nikita@sercond:/tmp/bug> cat > p2/DEBIAN/control
Package: p2
Version: 1
Maintainer: nobody@nobody.org
Description: test package p2
Architecture: all
Depends: p1 (= 1)

nikita@sercond:/tmp/bug> dpkg -b p2 p2.deb
dpkg-deb: building package `p2' in `p2.deb'.

nikita@sercond:/tmp/bug> dpkg -i p2.deb
Selecting previously deselected package p2.
(Reading database ... 116504 files and directories currently installed.)
Unpacking p2 (from p2.deb) ...
dpkg: dependency problems prevent configuration of p2:
 p2 depends on p1 (= 1); however:
  Package p1 is not installed.
dpkg: error processing p2 (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 p2

nikita@sercond:/tmp/bug> dpkg -i p1_1.deb
Selecting previously deselected package p1.
(Reading database ... 116505 files and directories currently installed.)
Unpacking p1 (from p1_1.deb) ...
Setting up p1 (1) ...

nikita@sercond:/tmp/bug> dpkg --configure p2
Setting up p2 (1) ...

nikita@sercond:/tmp/bug> dpkg -i p1_2.deb
(Reading database ... 116506 files and directories currently installed.)
Preparing to replace p1 1 (using p1_2.deb) ...
Unpacking replacement p1 ...
Setting up p1 (2) ...

nikita@sercond:/tmp/bug> apt-get install -f
Reading Package Lists... Done
Building Dependency Tree... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  p2*
0 upgraded, 0 newly installed, 1 to remove and 85 not upgraded.
Need to get 0B of archives.
After unpacking 0B of additional disk space will be used.
Do you want to continue? [Y/n]

#217862#23
Date:
2004-03-11 15:13:26 UTC
From:
To:
I was tempted to merge #217862 and #170825 but I can't be sure
that they report the same bug since the former involves a
normal dependency and the latter involves a dependency on a
virtual package.  However, the submitters of these bugs may
be interested to compare notes.

#217862#28
Date:
2004-03-11 21:08:00 UTC
From:
To:
version of a package still satisfies the dependences that have been
satisfied by the old varsion of the same package.