Control: tags -1 unreproducible moreinfo

Hi!

On Mon, 2013-12-09 at 09:40:22 +0100, Guillem Jover wrote:
> On Mon, 2013-12-09 at 07:03:41 +0100, Andreas Beckmann wrote:
> > Package: dpkg
> > Version: 1.17.4
> > Severity: serious
> 
> > consider the following packages shipping a few files:
> > 
> > foo 1.0
> > /usr/foo/foo.dat
> > 
> > foobar 2.0
> > /usr/foobar/foo.dat
> > 
> > foo 2.0 (Depends: foobar)
> > /usr/foo -> foobar
> > 
> > foo 2.0 uses dpkg-maintscript-helper dir_to_symlink to properly perform
> > the conversion.
> > 
> > After the following sequence, /usr/foobar/foo.dat is missing:
> > 
> > install foo 1.0
> > install foobar 2.0
> > install foo 2.0
> > 
> > I think the following is happen during the installation of foo 2.0:
> > 
> > * the preinst moves /usr/foo/ aside
> > * the package gets unpacked, creating /usr/foo -> foobar
> > * the obsolete files from foo 1.0 that are no longer in foo 2.0 get
> >   deleted, this finds /usr/foo/foo.dat which exists, but is actually
> >   /usr/foobar/foo.dat, but gets deleted anyway.
> 
> In theory that should be covered by the checks performed and the
> installation aborted. But I'm creating a test case right now to verify
> it.

Here's a functional test for the scenario above, but it does not
trigger the issue you report, because it bails out before any
problematic unpack. Please could you modify it to show what's the
problem?

It's against <git://anonscm.debian.org/git/dpkg/pkg-tests.git>.

> > Observed while debugging the piuparts failures of python-babel on
> > upgrades from jessie to sid.
> 
> This is with a local package right? Because the one in the archive
> does not contain any dir_to_symlink code.

Could it be it's something else in the packaging, to try to overcome
the abort from dpkg-maintscript-helper?

Thanks,
Guillem
diff --git a/t-switch-dir-to-symlink/Makefile b/t-switch-dir-to-symlink/Makefile
index 0988703..ca8dcb6 100644
--- a/t-switch-dir-to-symlink/Makefile
+++ b/t-switch-dir-to-symlink/Makefile
@@ -1,10 +1,27 @@
 TESTS_DEB := pkg-dir-real pkg-dir-symlink-0 pkg-dir-symlink-1 \
-             pkg-dir-conffile-0 pkg-dir-conffile-1
+             pkg-dir-conffile-0 pkg-dir-conffile-1 \
+             pkg-dir-foo-0 pkg-dir-foo-1 pkg-dir-foobar-1
 
 include ../Test.mk
 
 test-case:
 	# Cannot switch a directory containing conffiles
+	$(DPKG_INSTALL) pkg-dir-foo-0.deb
+	test -d /test-path
+	$(DPKG_INSTALL) pkg-dir-foobar-1.deb
+	test -d /test-path
+	test -d /test-pathdir
+	! $(DPKG_INSTALL) pkg-dir-foo-1.deb
+	! test -h /test-path
+	! test -h /test-pathdir
+	test -d /test-path
+	test -f /test-path/file-conf
+	test -d /test-pathdir
+	test -f /test-pathdir/file-conf
+	$(DPKG_PURGE) pkg-dir-foo
+	$(DPKG_PURGE) pkg-dir-foobar
+
+	# Cannot switch a directory containing conffiles
 	$(DPKG_INSTALL) pkg-dir-conffile-0.deb
 	test -d /test-path
 	! $(DPKG_INSTALL) pkg-dir-conffile-1.deb
@@ -43,6 +60,8 @@ test-case:
 	! test -e /test-path
 
 test-clean:
+	$(DPKG_PURGE) pkg-dir-foo
+	$(DPKG_PURGE) pkg-dir-foobar
 	$(DPKG_PURGE) pkg-dir-conffile
 	$(DPKG_PURGE) pkg-dir-symlink
 	$(DPKG_PURGE) pkg-dir-real
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/conffiles b/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/conffiles
new file mode 100644
index 0000000..296ef19
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-path/file-conf
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/control b/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/control
new file mode 100644
index 0000000..a52bf4b
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-0/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-dir-foo
+Version: 0
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <[email protected]>
+Architecture: all
+Description: test package - package with dir to be switched to symlink
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-0/test-path/file-conf b/t-switch-dir-to-symlink/pkg-dir-foo-0/test-path/file-conf
new file mode 100644
index 0000000..e69de29
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/control b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/control
new file mode 100644
index 0000000..390c27e
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/control
@@ -0,0 +1,8 @@
+Package: pkg-dir-foo
+Version: 1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <[email protected]>
+Architecture: all
+Depends: pkg-dir-foobar (>= 1)
+Description: test package - package switching dir to symlink
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postinst b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postinst
new file mode 100755
index 0000000..a4d98f1
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+if dpkg-maintscript-helper supports dir_to_symlink; then
+    dpkg-maintscript-helper dir_to_symlink /test-path /test-pathdir 0 -- "$@"
+fi
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postrm b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postrm
new file mode 100755
index 0000000..a4d98f1
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/postrm
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+if dpkg-maintscript-helper supports dir_to_symlink; then
+    dpkg-maintscript-helper dir_to_symlink /test-path /test-pathdir 0 -- "$@"
+fi
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/preinst b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/preinst
new file mode 100755
index 0000000..a4d98f1
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-1/DEBIAN/preinst
@@ -0,0 +1,5 @@
+#!/bin/sh
+set -e
+if dpkg-maintscript-helper supports dir_to_symlink; then
+    dpkg-maintscript-helper dir_to_symlink /test-path /test-pathdir 0 -- "$@"
+fi
diff --git a/t-switch-dir-to-symlink/pkg-dir-foo-1/test-path b/t-switch-dir-to-symlink/pkg-dir-foo-1/test-path
new file mode 120000
index 0000000..8938394
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foo-1/test-path
@@ -0,0 +1 @@
+test-pathdir
\ No newline at end of file
diff --git a/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/conffiles b/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/conffiles
new file mode 100644
index 0000000..9faacce
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test-pathdir/file-conf
diff --git a/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/control b/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/control
new file mode 100644
index 0000000..db7a847
--- /dev/null
+++ b/t-switch-dir-to-symlink/pkg-dir-foobar-1/DEBIAN/control
@@ -0,0 +1,7 @@
+Package: pkg-dir-foobar
+Version: 1
+Section: test
+Priority: extra
+Maintainer: Dpkg Developers <[email protected]>
+Architecture: all
+Description: test package - package with dir to be switched to symlink
diff --git a/t-switch-dir-to-symlink/pkg-dir-foobar-1/test-pathdir/file-conf b/t-switch-dir-to-symlink/pkg-dir-foobar-1/test-pathdir/file-conf
new file mode 100644
index 0000000..e69de29

Reply via email to