This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=cb49886e1b1da2f86f6894eb3d754673b37380e0 commit cb49886e1b1da2f86f6894eb3d754673b37380e0 Author: Raphaƫl Hertzog <[email protected]> AuthorDate: Thu Aug 19 10:25:07 2010 +0200 New tests: installation of conffile conflicting with a removed package The wanted behaviour might be different, there are discussions in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=163183 but for now it's best to ensure that we keep the current behaviour. --- t-conffile-conflict/Makefile | 38 +++++++++++++++++++--- t-conffile-conflict/pkg-conff-a/test-conffile | 1 + t-conffile-conflict/pkg-conff-b/test-conffile | 1 + .../{pkg-conff-a => pkg-conff-c}/DEBIAN/conffiles | 0 .../{pkg-conff-a => pkg-conff-c}/DEBIAN/control | 3 +- t-conffile-conflict/pkg-conff-c/test-conffile | 1 + 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/t-conffile-conflict/Makefile b/t-conffile-conflict/Makefile index 7942581f4..577818a39 100644 --- a/t-conffile-conflict/Makefile +++ b/t-conffile-conflict/Makefile @@ -1,13 +1,41 @@ -TESTS_DEB := pkg-conff-a pkg-conff-b +TESTS_DEB := pkg-conff-a pkg-conff-b pkg-conff-c include ../Test.mk -test-case: - # test if packages fail on install +test-case: test-conflict-installed-implicit test-conflict-removed-implicit \ + test-conflict-removed-explicit + +test-conflict-installed-implicit: + # test if packages fail on install due to conflicting conffile $(DPKG_INSTALL) pkg-conff-a.deb ! $(DPKG_INSTALL) pkg-conff-b.deb - -test-clean: -$(DPKG_PURGE) pkg-conff-b $(DPKG_PURGE) pkg-conff-a +test-conflict-removed-implicit: + # test that conffile of removed package can be taken over + $(DPKG_INSTALL) pkg-conff-a.deb + $(DPKG_REMOVE) pkg-conff-a + $(DPKG_INSTALL) pkg-conff-b.deb + # Veriy the new conffile has been installed + grep -q pkg-conff-b /test-conffile + # Verify it's kept after purge of old package + $(DPKG_PURGE) pkg-conff-a + test -e /test-conffile + $(DPKG_PURGE) pkg-conff-b + +test-conflict-removed-explicit: + # test that conffile of removed package can be taken over even if + # the new package is conflicting with the old one + $(DPKG_INSTALL) pkg-conff-a.deb + $(DPKG_REMOVE) pkg-conff-a + $(DPKG_INSTALL) pkg-conff-c.deb + # Veriy the new conffile has been installed + grep -q pkg-conff-c /test-conffile + # Verify it's kept after purge of old package + $(DPKG_PURGE) pkg-conff-a + test -e /test-conffile + $(DPKG_PURGE) pkg-conff-c + +test-clean: + -$(DPKG_PURGE) pkg-conff-a pkg-conff-b pkg-conff-c diff --git a/t-conffile-conflict/pkg-conff-a/test-conffile b/t-conffile-conflict/pkg-conff-a/test-conffile index e69de29bb..024da4966 100644 --- a/t-conffile-conflict/pkg-conff-a/test-conffile +++ b/t-conffile-conflict/pkg-conff-a/test-conffile @@ -0,0 +1 @@ +pkg-conff-a diff --git a/t-conffile-conflict/pkg-conff-b/test-conffile b/t-conffile-conflict/pkg-conff-b/test-conffile index e69de29bb..006fbc7d0 100644 --- a/t-conffile-conflict/pkg-conff-b/test-conffile +++ b/t-conffile-conflict/pkg-conff-b/test-conffile @@ -0,0 +1 @@ +pkg-conff-b diff --git a/t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles b/t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles similarity index 100% copy from t-conffile-conflict/pkg-conff-a/DEBIAN/conffiles copy to t-conffile-conflict/pkg-conff-c/DEBIAN/conffiles diff --git a/t-conffile-conflict/pkg-conff-a/DEBIAN/control b/t-conffile-conflict/pkg-conff-c/DEBIAN/control similarity index 78% copy from t-conffile-conflict/pkg-conff-a/DEBIAN/control copy to t-conffile-conflict/pkg-conff-c/DEBIAN/control index 06c759396..14845bda5 100644 --- a/t-conffile-conflict/pkg-conff-a/DEBIAN/control +++ b/t-conffile-conflict/pkg-conff-c/DEBIAN/control @@ -1,8 +1,9 @@ -Package: pkg-conff-a +Package: pkg-conff-c Version: 0 Section: test Priority: extra Maintainer: Guillem Jover <[email protected]> Architecture: all +Conflicts: pkg-conff-a Description: test package - conflicting conffile diff --git a/t-conffile-conflict/pkg-conff-c/test-conffile b/t-conffile-conflict/pkg-conff-c/test-conffile new file mode 100644 index 000000000..a6cfe3862 --- /dev/null +++ b/t-conffile-conflict/pkg-conff-c/test-conffile @@ -0,0 +1 @@ +pkg-conff-c -- Dpkg.Org's dpkg

