Dpkg::OpenPGP::Backend::GnuPG: Accept keybox format keyrings as-is
[dpkg.git] / tests / t-conffile-declarative-removal / Makefile
blob0d0e77b86a7c69017f62f78aed7cebfbbba01c1a
1 TESTS_DEB := pkg-conffile-v1 pkg-conffile-v2 \
2 pkg-conffile-owns-filename pkg-conffile-owns-symlink
4 include ../Test.mk
6 build-hook:
7 ln -sf test-conffile-owned \
8 pkg-conffile-owns-symlink/test-dir/test-conffile-to-be-removed
10 clean-hook:
11 $(RM) pkg-conffile-owns-symlink/test-dir/test-conffile-to-be-removed
12 $(RM) pkg-conffile-removal-present.deb
14 test-case:
15 # Conffile marked for removal but present, cannot be installed.
16 $(DPKG_BUILD_DEB) --nocheck pkg-conffile-removal-present
17 ! $(DPKG_INSTALL) pkg-conffile-removal-present.deb
18 $(call pkg_is_not_installed,pkg-conffile-removal-present)
19 $(DPKG_PURGE) pkg-conffile-removal-present
21 # Unmodified case, one invocation.
22 $(DPKG_INSTALL) pkg-conffile-v1.deb
23 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
24 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
25 $(DPKG_INSTALL) pkg-conffile-v2.deb
26 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
27 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
29 # Reset.
30 $(DPKG_PURGE) pkg-conffile
31 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
32 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
34 # Unmodified case; but force it to happen via two invocations.
35 $(DPKG_INSTALL) pkg-conffile-v1.deb
36 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
37 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
38 $(DPKG_UNPACK) pkg-conffile-v2.deb
39 # The old conffile is removed during unpack.
40 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
41 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
42 # After configure, the file is still removed.
43 $(DPKG_CONFIGURE) pkg-conffile
44 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
45 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
47 # Reset.
48 $(DPKG_PURGE) pkg-conffile
49 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
50 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
52 # Modified; should store .dpkg-old.
53 $(DPKG_INSTALL) pkg-conffile-v1.deb
54 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
55 echo "modify this" >"$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
56 $(DPKG_INSTALL) pkg-conffile-v2.deb
57 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
58 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
60 # Reset.
61 $(DPKG_PURGE) pkg-conffile
62 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
63 $(RM) "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
65 # Queue a remove on upgrade, and move ownership.
66 $(DPKG_INSTALL) pkg-conffile-v1.deb
67 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
68 $(DPKG_INSTALL) pkg-conffile-v2.deb
69 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
70 $(DPKG_INSTALL) pkg-conffile-owns-filename.deb
71 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
72 # Upgrade the package again, should not remove unowned conffile.
73 $(DPKG_INSTALL) pkg-conffile-v2.deb
74 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
75 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
77 # Reset.
78 $(DPKG_PURGE) pkg-conffile
79 $(DPKG_PURGE) pkg-conffile-owns
80 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
81 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
83 # Queue a remove on upgrade, and move ownership via symlink.
84 $(DPKG_INSTALL) pkg-conffile-v1.deb
85 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
86 $(DPKG_INSTALL) pkg-conffile-v2.deb
87 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
88 test ! -f "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed.dpkg-old"
89 $(DPKG_INSTALL) pkg-conffile-owns-symlink.deb
90 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-owned"
91 test -L "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
92 # Upgrade the package again, should not remove unowned conffile.
93 $(DPKG_INSTALL) pkg-conffile-v2.deb
94 test -f "$(DPKG_INSTDIR)/test-dir/test-conffile-owned"
95 test -L "$(DPKG_INSTDIR)/test-dir/test-conffile-to-be-removed"
97 test-clean:
98 $(DPKG_PURGE) pkg-conffile-removal-present
99 $(DPKG_PURGE) pkg-conffile-owns
100 $(DPKG_PURGE) pkg-conffile
101 $(BEROOT) $(RM) -rf "$(DPKG_INSTDIR)/test-dir"