From cbffab246997fb5a06211dfb706b54e5ae5bb59f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:58:51 +0200 Subject: Adding upstream version 1.21.22. Signed-off-by: Daniel Baumann --- tests/t-conffile-obsolete/Makefile | 42 ++++++++++++++++++++++ .../pkg-conff-obsolete-0/DEBIAN/conffiles | 1 + .../pkg-conff-obsolete-0/DEBIAN/control | 8 +++++ .../pkg-conff-obsolete-0/test-conffile | 1 + .../pkg-conff-obsolete-1/DEBIAN/control | 8 +++++ .../pkg-conff-obsolete-2/DEBIAN/control | 8 +++++ .../pkg-conff-obsolete-2/DEBIAN/postinst | 4 +++ .../pkg-conff-obsolete-2/DEBIAN/postrm | 4 +++ .../pkg-conff-obsolete-2/DEBIAN/preinst | 9 +++++ 9 files changed, 85 insertions(+) create mode 100644 tests/t-conffile-obsolete/Makefile create mode 100644 tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/conffiles create mode 100644 tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/control create mode 100644 tests/t-conffile-obsolete/pkg-conff-obsolete-0/test-conffile create mode 100644 tests/t-conffile-obsolete/pkg-conff-obsolete-1/DEBIAN/control create mode 100644 tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/control create mode 100755 tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postinst create mode 100755 tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postrm create mode 100755 tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/preinst (limited to 'tests/t-conffile-obsolete') diff --git a/tests/t-conffile-obsolete/Makefile b/tests/t-conffile-obsolete/Makefile new file mode 100644 index 0000000..55d9477 --- /dev/null +++ b/tests/t-conffile-obsolete/Makefile @@ -0,0 +1,42 @@ +TESTS_DEB := pkg-conff-obsolete-0 pkg-conff-obsolete-1 pkg-conff-obsolete-2 + +include ../Test.mk + +test-case: + $(DPKG_INSTALL) pkg-conff-obsolete-0.deb + $(DPKG_INSTALL) pkg-conff-obsolete-1.deb + test -f '$(DPKG_INSTDIR)/test-conffile' + $(DPKG_PURGE) pkg-conff-obsolete + test ! -f '$(DPKG_INSTDIR)/test-conffile' + # Unmodified conffile is autoremoved for the user + $(DPKG_INSTALL) pkg-conff-obsolete-0.deb + $(DPKG_UNPACK) pkg-conff-obsolete-2.deb + test -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup' + $(DPKG_CONFIGURE) pkg-conff-obsolete + test ! -f '$(DPKG_INSTDIR)/test-conffile' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove' + $(DPKG_PURGE) pkg-conff-obsolete + # Modified conffile is moved away in .dpkg-bak for the user + $(DPKG_INSTALL) pkg-conff-obsolete-0.deb + $(BEROOT) sh -c "echo foo >>'$(DPKG_INSTDIR)/test-conffile'" + $(DPKG_INSTALL) pkg-conff-obsolete-2.deb + test ! -f '$(DPKG_INSTDIR)/test-conffile' + test -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak' + $(DPKG_PURGE) pkg-conff-obsolete + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak' + # Abort-upgrade restores the to-be-removed conffile + $(DPKG_INSTALL) pkg-conff-obsolete-0.deb + $(BEROOT) touch '$(DPKG_INSTDIR)/fail-preinst' + $(DPKG_INSTALL) pkg-conff-obsolete-2.deb || true + $(BEROOT) rm -f '$(DPKG_INSTDIR)/fail-preinst' + test -f '$(DPKG_INSTDIR)/test-conffile' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-remove' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-bak' + test ! -f '$(DPKG_INSTDIR)/test-conffile.dpkg-backup' + +test-clean: + $(DPKG_PURGE) pkg-conff-obsolete + diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/conffiles b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/conffiles new file mode 100644 index 0000000..4fad7e9 --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/conffiles @@ -0,0 +1 @@ +/test-conffile diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/control b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/control new file mode 100644 index 0000000..664592c --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-conff-obsolete +Version: 0 +Section: test +Priority: extra +Maintainer: Dpkg Developers +Architecture: all +Description: test package - conffile obsolete + diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-0/test-conffile b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/test-conffile new file mode 100644 index 0000000..6fbc8b5 --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-0/test-conffile @@ -0,0 +1 @@ +test init diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-1/DEBIAN/control b/tests/t-conffile-obsolete/pkg-conff-obsolete-1/DEBIAN/control new file mode 100644 index 0000000..b7e111e --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-1/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-conff-obsolete +Version: 1 +Section: test +Priority: extra +Maintainer: Dpkg Developers +Architecture: all +Description: test package - conffile obsolete + diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/control b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/control new file mode 100644 index 0000000..b7e111e --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/control @@ -0,0 +1,8 @@ +Package: pkg-conff-obsolete +Version: 1 +Section: test +Priority: extra +Maintainer: Dpkg Developers +Architecture: all +Description: test package - conffile obsolete + diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postinst b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postinst new file mode 100755 index 0000000..c6b0782 --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postinst @@ -0,0 +1,4 @@ +#!/bin/sh +if dpkg-maintscript-helper supports rm_conffile; then + dpkg-maintscript-helper rm_conffile /test-conffile 0 -- "$@" +fi diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postrm b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postrm new file mode 100755 index 0000000..c6b0782 --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/postrm @@ -0,0 +1,4 @@ +#!/bin/sh +if dpkg-maintscript-helper supports rm_conffile; then + dpkg-maintscript-helper rm_conffile /test-conffile 0 -- "$@" +fi diff --git a/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/preinst b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/preinst new file mode 100755 index 0000000..c0e592b --- /dev/null +++ b/tests/t-conffile-obsolete/pkg-conff-obsolete-2/DEBIAN/preinst @@ -0,0 +1,9 @@ +#!/bin/sh +if dpkg-maintscript-helper supports rm_conffile; then + dpkg-maintscript-helper rm_conffile /test-conffile 0 -- "$@" +fi + +if [ -e "$DPKG_ROOT/fail-preinst" ]; then + exit 1 +fi + -- cgit v1.2.3