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

Bug#239322: Dependency should determine unpack order



Package: dpkg
Version: 1.10.19
Severity: wishlist

Currently dpkg unpacks packages in the order that they are listed on the
command line.  In contrast, dpkg configures packages in an order that
conforms to dependency relations.

To illustrate this I created two packages, foo and bar, where bar
Depends on foo.

$ sudo dpkg -i foo_1.0_all.deb bar_1.0_all.deb
Selecting previously deselected package foo.
(Reading database ... 125693 files and directories currently installed.)
Unpacking foo (from foo_1.0_all.deb) ...
Selecting previously deselected package bar.
Unpacking bar (from bar_1.0_all.deb) ...
Setting up foo (1.0) ...
Setting up bar (1.0) ...

$ sudo dpkg --purge foo bar
(Reading database ... 125698 files and directories currently installed.)
Removing bar ...
Removing foo ...

$ sudo dpkg -i bar_1.0_all.deb foo_1.0_all.deb
Selecting previously deselected package bar.
(Reading database ... 125693 files and directories currently installed.)
Unpacking bar (from bar_1.0_all.deb) ...
Selecting previously deselected package foo.
Unpacking foo (from foo_1.0_all.deb) ...
Setting up foo (1.0) ...
Setting up bar (1.0) ...


In both cases, foo is configured before bar (good).  However the unpack
order depends on the order in which the packages are given on the
command line.  This is less than ideal.  Sometimes it is important for
the Depended-on package to be (not only configured but) unpacked before
the Dependent package.  This is the case, for example, if one package
Replaces another and needs to replace the latter's conffiles.  This
only happens properly if the adopter is unpacked before the abandoner.

The only way to enforce unpack order currently is by declaring a
Pre-Dependency, but this is sometimes too strong a dependency.

To give a specific example (the one that gives rise to this wish):
initscripts needs to adopt conffiles belonging to an old version of
sysvinit.  The new version of sysvinit lacks the conffiles.  For the
adoption to go smoothly, initscripts needs to be unpacked before the
new sysvinit package.  It would be nice if this could be enforced by
having the new sysvinit Depend on initscripts, but as things are we
have to make the new sysvinit Pre-Depend on initscripts.

There may be reasons why the unpack order should follow the command
line order.  If so, please explain and mark this report "wontfix".

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (800, 'testing'), (700, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.4.24
Locale: LANG=en_IE@euro, LC_CTYPE=en_IE@euro

Versions of packages dpkg depends on:
ii  dselect                     1.10.19      a user tool to manage Debian packa
ii  libc6                       2.3.2.ds1-11 GNU C Library: Shared libraries an

-- no debconf information




Reply to: