Package: dpkg
Version: 1.15.0
Severity: normal

This is the case:
----------------------------------

Package B depends on package A and package B does a diversion (in preinst
with --rename) of a conffile in package A and installs a file on
the orginal location.

We're going to install package B.

The resulting issue:
----------------------------------

It turns out that the original conffile of package A isn't renamed. In
contrast to that, ordinary files WILL be.

The cause:
----------------------------------

During the install process (after unpack), conffiles have temporarily a
".dpkg-new" suffix. If, on that particular moment, a preinst from a different
package tries to divert (and rename) a conffile, it cannot rename the
file, because it cannot find it on the original location (without .dpkg-new).

Tested on:
----------------------------------

Lenny with dpkg 1.15.0 (git HEAD of 2008-07-24).

Test packages:
----------------------------------

I've attached test packages that demonstrate the issue. test-pkg-a
(package A) and test-pkg-b (package B).

Test output:
----------------------------------

In the demonstration test-pkg-b diverts /etc/test-pkg-a/config-file and
/usr/share/test-pkg-a/ordinary-file of test-pkg-a.

# apt-get install test-pkg-b
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  test-pkg-a
The following NEW packages will be installed:
  test-pkg-a test-pkg-b
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
Need to get 3072B of archives.
After this operation, 135kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://packages.xx.xxxx.xx lenny/main test-pkg-a 0.1 [1314B]
Get:2 http://packages.xx.xxxx.xx lenny/main test-pkg-b 0.1 [1758B]
Fetched 3072B in 0s (0B/s)
Selecting previously deselected package test-pkg-a.
(Reading database ... 17350 files and directories currently installed.)
Unpacking test-pkg-a (from .../test-pkg-a_0.1_all.deb) ...
Selecting previously deselected package test-pkg-b.
Unpacking test-pkg-b (from .../test-pkg-b_0.1_all.deb) ...
Adding `diversion of /etc/test-pkg-a/config-file to
/etc/test-pkg-a/config-file.diverted by test-pkg-b'
Adding `diversion of /usr/share/test-pkg-a/ordinary-file to
/usr/share/test-pkg-a/ordinary-file.diverted by test-pkg-b'
Setting up test-pkg-a (0.1) ...
Setting up test-pkg-b (0.1) ...
# ls -l /usr/share/test-pkg-a
total 12
-rw-r--r-- 1 root root 9 2008-07-24 14:25 another-file
-rw-r--r-- 1 root root 9 2008-07-24 15:01 ordinary-file
-rw-r--r-- 1 root root 9 2008-07-24 14:24 ordinary-file.diverted
# ls -l /usr/share/test-pkg-b
total 4
-rw-r--r-- 1 root root 9 2008-07-24 15:09 another-file
# ls -l /etc/test-pkg-a/
total 4
-rw-r--r-- 1 root root 9 2008-07-24 15:01 config-file
#

As you see, ordinary-file is renamed, config-file is not.

----------------------------------

I know diverting of conffiles isn't a supported feature by Debian, but it
would be great if this issue would be fixed though.


Durk

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.25-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages dpkg depends on:
ii  coreutils                     6.10-6     The GNU core utilities
ii  libc6                         2.7-10     GNU C Library: Shared libraries

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt                           0.7.14+b1  Advanced front-end for dpkg
pn  lzma                          <none>     (no description available)

-- debconf-show failed



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to