这是indexloc提供的服务,不要输入任何密码

Debian Bug report logs - #492222
dpkg-divert: renaming doesn't work sometimes when diverting a conffile in preinst

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg (PTS, buildd, popcon).

Reported by: Durk Strooisma <durk@kern.nl>

Date: Thu, 24 Jul 2008 13:54:01 UTC

Severity: normal

Found in version dpkg/1.15.0

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#492222; Package dpkg. (full text, mbox, link).


Acknowledgement sent to Durk Strooisma <durk@kern.nl>:
New Bug report received and forwarded. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Durk Strooisma <durk@kern.nl>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: dpkg: Renaming doesn't work in a particular case when diverting a conffile in preinst
Date: Thu, 24 Jul 2008 15:53:19 +0200
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




Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#492222; Package dpkg. (full text, mbox, link).


Acknowledgement sent to "Durk Strooisma" <durk@kern.nl>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #10 received at 492222@bugs.debian.org (full text, mbox, reply):

From: "Durk Strooisma" <durk@kern.nl>
To: <492222@bugs.debian.org>
Subject: Files attached
Date: Thu, 24 Jul 2008 15:57:23 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Here are the test packages.

[test-pkg-a_0.1_all.deb (application/x-deb, attachment)]
[test-pkg-a_0.1.dsc (application/octet-stream, attachment)]
[test-pkg-a_0.1.tar.gz (application/x-gzip, attachment)]
[test-pkg-b_0.1_all.deb (application/x-deb, attachment)]
[test-pkg-b_0.1.dsc (application/octet-stream, attachment)]
[test-pkg-b_0.1.tar.gz (application/x-gzip, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#492222; Package dpkg. (full text, mbox, link).


Acknowledgement sent to "Durk Strooisma" <durk@kern.nl>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <debian-dpkg@lists.debian.org>. (full text, mbox, link).


Message #15 received at 492222@bugs.debian.org (full text, mbox, reply):

From: "Durk Strooisma" <durk@kern.nl>
To: <492222@bugs.debian.org>
Subject: More info
Date: Thu, 24 Jul 2008 16:03:07 +0200 (CEST)
Forgot to mention:

Work-around:
----------------------------------

To work-around the issue, package A has to be listed as Pre-Depends in stead
of a normal Depends.






Changed Bug title to `dpkg-divert: renaming doesn't work sometimes when diverting a conffile in preinst' from `dpkg: Renaming doesn't work in a particular case when diverting a conffile in preinst'. Request was from Guillem Jover <guillem@debian.org> to control@bugs.debian.org. (Tue, 18 Nov 2008 08:18:13 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 26 20:15:29 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.