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

Possible dpkg regression



Hi Guillem,

I was about to file a bug against clang-3.3 but what I discovered looked
like more a bug in dpkg. It's probably related to the recent optimizations
that concerns management of file lists.

In today's dist-upgrade:

Unpacking llvm-3.3 (1:3.3-13) over (1:3.3-12) ...
Preparing to unpack .../clang-3.3_1%3a3.3-13_amd64.deb ...
Unpacking clang-3.3 (1:3.3-13) over (1:3.3-12) ...
dpkg: error processing archive /var/cache/apt/archives/clang-3.3_1%3a3.3-13_amd64.deb (--unpack):
 tentative de remplacement de « /usr/lib/llvm-3.3/bin/c-index-test », qui appartient aussi au paquet llv
m-3.3 1:3.3-13
dpkg-deb : erreur : le sous-processus coller a été tué par le signal (Relais brisé (pipe))
Preparing to unpack .../libclang-common-3.3-dev_1%3a3.3-13_amd64.deb ...
Unpacking libclang-common-3.3-dev (1:3.3-13) over (1:3.3-12) ...
Preparing to unpack .../libllvm3.3_1%3a3.3-13_amd64.deb ...
De-configuring libllvm3.3:i386 (1:3.3-12) ...
Unpacking libllvm3.3:amd64 (1:3.3-13) over (1:3.3-12) ...
Preparing to unpack .../libllvm3.3_1%3a3.3-13_i386.deb ...
Unpacking libllvm3.3:i386 (1:3.3-13) over (1:3.3-12) ...

(This is the french string for a file conflict detected by dpkg)

Strangely, the next "apt-get -f install" fixed it even though llvm-3.3 had
already been unpacked and thus nothing was supposed to change.

Preparing to unpack .../clang-3.3_1%3a3.3-13_amd64.deb ...
Unpacking clang-3.3 (1:3.3-13) over (1:3.3-12) ...
Preparing to unpack .../libclang1-3.3_1%3a3.3-13_amd64.deb ...
Unpacking libclang1-3.3:amd64 (1:3.3-13) over (1:3.3-12) ...
Preparing to unpack .../llvm-3.3-runtime_1%3a3.3-13_amd64.deb ...
Unpacking llvm-3.3-runtime (1:3.3-13) over (1:3.3-12) ...

$ dpkg -c /var/cache/apt/archives/llvm-3.3_1%3a3.3-13_amd64.deb |grep c-index-test
$ dpkg -c /var/cache/apt/archives/llvm-3.3_1%3a3.3-12_amd64.deb |grep c-index-test
-rwxr-xr-x root/root     87256 2013-10-29 19:46 ./usr/lib/llvm-3.3/bin/c-index-test
lrwxrwxrwx root/root         0 2013-10-29 19:45 ./usr/bin/c-index-test-3.3 -> ../lib/llvm-3.3/bin/c-index-test
$ dpkg -c /var/cache/apt/archives/clang-3.3_1%3a3.3-12_amd64.deb |grep c-index-test
$ dpkg -c /var/cache/apt/archives/clang-3.3_1%3a3.3-13_amd64.deb |grep c-index-test
-rwxr-xr-x root/root     87256 2013-11-05 15:07 ./usr/lib/llvm-3.3/bin/c-index-test
lrwxrwxrwx root/root         0 2013-11-05 15:06 ./usr/bin/c-index-test-3.3 -> ../lib/llvm-3.3/bin/c-index-test

But clang-3.3 1:2.3-13 has an appropriate Replaces already "llvm-3.3 (<<
1:3.3-13)".  It also has the same Breaks (not Conflicts). AFAIK the
Replaces alone should have been more than enough, here it looks like that
dpkg has kept ./usr/lib/llvm-3.3/bin/c-index-test associated to llvm-3.3
even though that package has been upgraded. The next dpkg run fixed this
(possibly because it reloaded the file list from the disk instead).

I have created a minimal test case for this, it's attached and I can
reproduce the problem with it:

# test-one-run-ordered
sudo env  dpkg --admindir=/home/rhertzog/deb/core/pkg-tests/t-file-replaces-versioned/../dpkgdb --force-unsafe-io --no-debsig -i pkg-file-original-0.deb pkg-file-takeover-0.deb
Selecting previously unselected package pkg-file-original.
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack pkg-file-original-0.deb ...
Unpacking pkg-file-original (0) ...
Selecting previously unselected package pkg-file-takeover.
Preparing to unpack pkg-file-takeover-0.deb ...
Unpacking pkg-file-takeover (0) ...
Setting up pkg-file-original (0) ...
Setting up pkg-file-takeover (0) ...
sudo env  dpkg --admindir=/home/rhertzog/deb/core/pkg-tests/t-file-replaces-versioned/../dpkgdb --force-unsafe-io --no-debsig -i pkg-file-original-1.deb pkg-file-takeover-1.deb
(Reading database ... 4 files and directories currently installed.)
Preparing to unpack pkg-file-original-1.deb ...
Unpacking pkg-file-original (1) over (0) ...
Preparing to unpack pkg-file-takeover-1.deb ...
Unpacking pkg-file-takeover (1) over (0) ...
dpkg: error processing archive pkg-file-takeover-1.deb (--install):
 trying to overwrite '/test-file', which is also in package pkg-file-original 1
Setting up pkg-file-original (1) ...
Errors were encountered while processing:
 pkg-file-takeover-1.deb

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
>From 33a715b1f33dbbeb4848a29443509d60f1e87879 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
Date: Thu, 21 Nov 2013 10:43:49 +0100
Subject: [PATCH] New t-file-replaces-versioned test case

This one checks moving a file from package A to B when a A/0 and B/0
are both initially installed. B/1 has a replaces on A (<< 1) to avoid
the file conflict.
---
 t-file-replaces-versioned/Makefile                 | 51 ++++++++++++++++++++++
 .../pkg-file-original-0/DEBIAN/control             |  8 ++++
 .../pkg-file-original-0/test-file                  |  1 +
 .../pkg-file-original-0/test-original              |  0
 .../pkg-file-original-1/DEBIAN/control             |  8 ++++
 .../pkg-file-original-1/test-original              |  0
 .../pkg-file-takeover-0/DEBIAN/control             |  9 ++++
 .../pkg-file-takeover-0/test-takeover              |  0
 .../pkg-file-takeover-1/DEBIAN/control             |  9 ++++
 .../pkg-file-takeover-1/test-file                  |  1 +
 .../pkg-file-takeover-1/test-takeover              |  0
 t-file-replaces-versioned/ref-file                 |  1 +
 12 files changed, 88 insertions(+)
 create mode 100644 t-file-replaces-versioned/Makefile
 create mode 100644 t-file-replaces-versioned/pkg-file-original-0/DEBIAN/control
 create mode 100644 t-file-replaces-versioned/pkg-file-original-0/test-file
 create mode 100644 t-file-replaces-versioned/pkg-file-original-0/test-original
 create mode 100644 t-file-replaces-versioned/pkg-file-original-1/DEBIAN/control
 create mode 100644 t-file-replaces-versioned/pkg-file-original-1/test-original
 create mode 100644 t-file-replaces-versioned/pkg-file-takeover-0/DEBIAN/control
 create mode 100644 t-file-replaces-versioned/pkg-file-takeover-0/test-takeover
 create mode 100644 t-file-replaces-versioned/pkg-file-takeover-1/DEBIAN/control
 create mode 100644 t-file-replaces-versioned/pkg-file-takeover-1/test-file
 create mode 100644 t-file-replaces-versioned/pkg-file-takeover-1/test-takeover
 create mode 100644 t-file-replaces-versioned/ref-file

diff --git a/t-file-replaces-versioned/Makefile b/t-file-replaces-versioned/Makefile
new file mode 100644
index 0000000..fc9ec50
--- /dev/null
+++ b/t-file-replaces-versioned/Makefile
@@ -0,0 +1,51 @@
+TESTS_DEB := pkg-file-original-0 pkg-file-original-1 pkg-file-takeover-0 pkg-file-takeover-1
+
+include ../Test.mk
+
+TEST_CASES += test-two-run-ordered
+TEST_CASES += test-one-run-ordered
+TEST_CASES += test-two-run-reverse
+TEST_CASES += test-one-run-reverse
+
+test-case: $(TEST_CASES)
+
+define VERIFY
+test "`$(PKG_STATUS) pkg-file-original`" = "install ok installed"
+test "`$(PKG_STATUS) pkg-file-takeover`" = "install ok installed"
+test "`$(DPKG_QUERY) -S /test-file`" = "pkg-file-takeover: /test-file"
+cmp ref-file /test-file
+endef
+
+test-two-run-ordered:
+	# test-two-run-ordered
+	$(DPKG_INSTALL) pkg-file-original-0.deb pkg-file-takeover-0.deb
+	$(DPKG_INSTALL) pkg-file-original-1.deb
+	$(DPKG_INSTALL) pkg-file-takeover-1.deb
+	$(VERIFY)
+	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
+
+test-one-run-ordered:
+	# test-one-run-ordered
+	$(DPKG_INSTALL) pkg-file-original-0.deb pkg-file-takeover-0.deb
+	$(DPKG_INSTALL) pkg-file-original-1.deb pkg-file-takeover-1.deb
+	$(DPKG_CONFIGURE) -a
+	$(VERIFY)
+	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
+
+test-two-run-reverse:
+	# test-two-run-reverse
+	$(DPKG_INSTALL) pkg-file-original-0.deb pkg-file-takeover-0.deb
+	$(DPKG_INSTALL) pkg-file-takeover-1.deb
+	$(DPKG_INSTALL) pkg-file-original-1.deb
+	$(VERIFY)
+	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
+
+test-one-run-reverse:
+	# test-one-run-reverse
+	$(DPKG_INSTALL) pkg-file-original-0.deb pkg-file-takeover-0.deb
+	$(DPKG_INSTALL) pkg-file-takeover-1.deb pkg-file-original-1.deb
+	$(VERIFY)
+	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
+
+test-clean:
+	$(DPKG_PURGE) pkg-file-original pkg-file-takeover
diff --git a/t-file-replaces-versioned/pkg-file-original-0/DEBIAN/control b/t-file-replaces-versioned/pkg-file-original-0/DEBIAN/control
new file mode 100644
index 0000000..305534f
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-original-0/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-file-original
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - provide a file
+
diff --git a/t-file-replaces-versioned/pkg-file-original-0/test-file b/t-file-replaces-versioned/pkg-file-original-0/test-file
new file mode 100644
index 0000000..7e3c47b
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-original-0/test-file
@@ -0,0 +1 @@
+test original
diff --git a/t-file-replaces-versioned/pkg-file-original-0/test-original b/t-file-replaces-versioned/pkg-file-original-0/test-original
new file mode 100644
index 0000000..e69de29
diff --git a/t-file-replaces-versioned/pkg-file-original-1/DEBIAN/control b/t-file-replaces-versioned/pkg-file-original-1/DEBIAN/control
new file mode 100644
index 0000000..cefb6ae
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-original-1/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-file-original
+Version: 1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Description: test package - provide a file
+
diff --git a/t-file-replaces-versioned/pkg-file-original-1/test-original b/t-file-replaces-versioned/pkg-file-original-1/test-original
new file mode 100644
index 0000000..e69de29
diff --git a/t-file-replaces-versioned/pkg-file-takeover-0/DEBIAN/control b/t-file-replaces-versioned/pkg-file-takeover-0/DEBIAN/control
new file mode 100644
index 0000000..fe18bce
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-takeover-0/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-file-takeover
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Replaces: pkg-file-original (<< 1)
+Description: test package - file replaces takeover
+
diff --git a/t-file-replaces-versioned/pkg-file-takeover-0/test-takeover b/t-file-replaces-versioned/pkg-file-takeover-0/test-takeover
new file mode 100644
index 0000000..e69de29
diff --git a/t-file-replaces-versioned/pkg-file-takeover-1/DEBIAN/control b/t-file-replaces-versioned/pkg-file-takeover-1/DEBIAN/control
new file mode 100644
index 0000000..79e6097
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-takeover-1/DEBIAN/control
@@ -0,0 +1,9 @@
+Package: pkg-file-takeover
+Version: 1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
+Architecture: all
+Replaces: pkg-file-original (<< 1)
+Description: test package - file replaces takeover
+
diff --git a/t-file-replaces-versioned/pkg-file-takeover-1/test-file b/t-file-replaces-versioned/pkg-file-takeover-1/test-file
new file mode 100644
index 0000000..82fe7fe
--- /dev/null
+++ b/t-file-replaces-versioned/pkg-file-takeover-1/test-file
@@ -0,0 +1 @@
+test takeover
diff --git a/t-file-replaces-versioned/pkg-file-takeover-1/test-takeover b/t-file-replaces-versioned/pkg-file-takeover-1/test-takeover
new file mode 100644
index 0000000..e69de29
diff --git a/t-file-replaces-versioned/ref-file b/t-file-replaces-versioned/ref-file
new file mode 100644
index 0000000..82fe7fe
--- /dev/null
+++ b/t-file-replaces-versioned/ref-file
@@ -0,0 +1 @@
+test takeover
-- 
1.8.4.3


Reply to: