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=00bff507e351682e9f5da1267d28192d776f0420

commit 00bff507e351682e9f5da1267d28192d776f0420
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Apr 3 11:06:17 2017 +0200

    t-conffile-replaces-diverted: New test case
---
 Feature.mk                                              |  1 +
 Makefile                                                |  3 +++
 t-conffile-replaces-diverted/Makefile                   | 17 +++++++++++++++++
 .../pkg-conff-0/DEBIAN/conffiles                        |  1 +
 .../pkg-conff-0}/DEBIAN/control                         |  1 -
 t-conffile-replaces-diverted/pkg-conff-0/test/conffile  |  1 +
 .../pkg-conff-1}/DEBIAN/control                         |  5 ++---
 .../pkg-conff-move/DEBIAN/conffiles                     |  1 +
 .../pkg-conff-move}/DEBIAN/control                      |  5 +++--
 .../pkg-conff-move/test/conffile                        |  1 +
 10 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/Feature.mk b/Feature.mk
index e7aa54c4c..8e2a6aefc 100644
--- a/Feature.mk
+++ b/Feature.mk
@@ -43,6 +43,7 @@ export DPKG_HAS_STRICT_DEB_ARCHITECTURE_FIELD ?= 1
 export DPKG_HAS_REPRODUCIBLE_SOURCES ?= 1
 export DPKG_HAS_LAX_DB_BLANK_LINE_PARSER ?= 1
 export DPKG_BUILD_PKG_HAS_IGNORE_BUILTIN_BUILDDEPS ?= 1
+export DPKG_CAN_REPLACE_DIVERTED_CONFFILE ?= 1
 endif
 
 ifneq (,$(filter not-root,$(DPKG_TESTSUITE_OPTIONS)))
diff --git a/Makefile b/Makefile
index 996fab138..e02f242b1 100644
--- a/Makefile
+++ b/Makefile
@@ -114,6 +114,9 @@ TESTS_PASS += t-conffile-replaces-downgrade
 TESTS_PASS += t-conffile-replaces-existing
 TESTS_PASS += t-conffile-replaces-existing-and-upgrade
 TESTS_PASS += t-conffile-replaces-disappear
+ifdef DPKG_CAN_REPLACE_DIVERTED_CONFFILE
+TESTS_PASS += t-conffile-replaces-diverted
+endif
 TESTS_PASS += t-conffile-versioned-replaces-downgrade
 ifndef DPKG_NOT_ROOT
 # FIXME: dpkg-maintscript-helper does not support $DPKG_ROOT (#832176)
diff --git a/t-conffile-replaces-diverted/Makefile 
b/t-conffile-replaces-diverted/Makefile
new file mode 100644
index 000000000..15fce4f78
--- /dev/null
+++ b/t-conffile-replaces-diverted/Makefile
@@ -0,0 +1,17 @@
+TESTS_DEB := pkg-conff-0 pkg-conff-1 pkg-conff-move
+
+include ../Test.mk
+
+DPKG_DIVERT_OPTIONS = --local --rename --divert /test/conffile.moved
+
+test-case:
+       $(DPKG_INSTALL) pkg-conff-0.deb
+       $(DPKG_DIVERT_ADD) /test/conffile
+       # Test if the other package can takeover a diverted conffile w/o error.
+       $(DPKG_INSTALL) pkg-conff-1.deb
+       $(DPKG_INSTALL) pkg-conff-move.deb
+
+test-clean:
+       $(DPKG_DIVERT_DEL) /test/conffile
+       $(DPKG_PURGE) pkg-conff
+       $(DPKG_PURGE) pkg-conff-move
diff --git a/t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/conffiles 
b/t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/conffiles
new file mode 100644
index 000000000..e2b8681a4
--- /dev/null
+++ b/t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test/conffile
diff --git a/t-conffile-divert-conffile/pkg-conff/DEBIAN/control 
b/t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/control
similarity index 99%
copy from t-conffile-divert-conffile/pkg-conff/DEBIAN/control
copy to t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/control
index 8a3a6f508..13bd5aa90 100644
--- a/t-conffile-divert-conffile/pkg-conff/DEBIAN/control
+++ b/t-conffile-replaces-diverted/pkg-conff-0/DEBIAN/control
@@ -5,4 +5,3 @@ Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
 Description: test package - provide a conffile
-
diff --git a/t-conffile-replaces-diverted/pkg-conff-0/test/conffile 
b/t-conffile-replaces-diverted/pkg-conff-0/test/conffile
new file mode 100644
index 000000000..08db75909
--- /dev/null
+++ b/t-conffile-replaces-diverted/pkg-conff-0/test/conffile
@@ -0,0 +1 @@
+This is a conffile.
diff --git a/t-conffile-divert-conffile/pkg-conff/DEBIAN/control 
b/t-conffile-replaces-diverted/pkg-conff-1/DEBIAN/control
similarity index 63%
copy from t-conffile-divert-conffile/pkg-conff/DEBIAN/control
copy to t-conffile-replaces-diverted/pkg-conff-1/DEBIAN/control
index 8a3a6f508..bd499f57f 100644
--- a/t-conffile-divert-conffile/pkg-conff/DEBIAN/control
+++ b/t-conffile-replaces-diverted/pkg-conff-1/DEBIAN/control
@@ -1,8 +1,7 @@
 Package: pkg-conff
-Version: 0
+Version: 1
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
-Description: test package - provide a conffile
-
+Description: test package - provided a conffile, not anymore
diff --git a/t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/conffiles 
b/t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/conffiles
new file mode 100644
index 000000000..e2b8681a4
--- /dev/null
+++ b/t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/conffiles
@@ -0,0 +1 @@
+/test/conffile
diff --git a/t-breaks/lib-b-1/DEBIAN/control 
b/t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/control
similarity index 54%
copy from t-breaks/lib-b-1/DEBIAN/control
copy to t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/control
index 7c423caca..bcbdffa90 100644
--- a/t-breaks/lib-b-1/DEBIAN/control
+++ b/t-conffile-replaces-diverted/pkg-conff-move/DEBIAN/control
@@ -1,7 +1,8 @@
-Package: lib-b
+Package: pkg-conff-move
 Version: 1
 Section: test
 Priority: extra
 Maintainer: Dpkg Developers <[email protected]>
 Architecture: all
-Description: test package - broken package
+Replaces: pkg-conff (<< 1)
+Description: test package - takeover a conffile
diff --git a/t-conffile-replaces-diverted/pkg-conff-move/test/conffile 
b/t-conffile-replaces-diverted/pkg-conff-move/test/conffile
new file mode 100644
index 000000000..08db75909
--- /dev/null
+++ b/t-conffile-replaces-diverted/pkg-conff-move/test/conffile
@@ -0,0 +1 @@
+This is a conffile.

-- 
Dpkg.Org's dpkg

Reply via email to