summaryrefslogtreecommitdiffstats
path: root/tests/t-unpack-divert-overwrite/Makefile
blob: 1ddfdab4f6a8fe50b9fd6340d2c0297b28267a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
TESTS_DEB := pkg-files pkg-divert pkg-replaces

include ../Test.mk

test-case:
	# Test failure to install a package overwriting a diversion (order 1).
	$(DPKG_INSTALL) pkg-divert.deb
	test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other
	$(DPKG_INSTALL) pkg-files.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	! $(DPKG_INSTALL) pkg-replaces.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	$(call pkg_is_installed,pkg-divert)
	$(call pkg_is_not_installed,pkg-replaces)
	$(DPKG_PURGE) pkg-files
	$(DPKG_PURGE) pkg-divert
	$(DPKG_PURGE) pkg-replaces
	! test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other
	:
	# Test failure to install a package overwriting a diversion (order 2).
	$(DPKG_INSTALL) pkg-files.deb
	test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other
	$(DPKG_INSTALL) pkg-divert.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	! $(DPKG_INSTALL) pkg-replaces.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	$(call pkg_is_installed,pkg-divert)
	$(call pkg_is_not_installed,pkg-replaces)
	$(DPKG_PURGE) pkg-files
	$(DPKG_PURGE) pkg-divert
	$(DPKG_PURGE) pkg-replaces
	! test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other
	:
	# Test success to install a package overwriting a diversion (forced).
	$(DPKG_INSTALL) pkg-files.deb
	test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other
	$(DPKG_INSTALL) pkg-divert.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	$(DPKG_INSTALL) --force-overwrite-diverted pkg-replaces.deb
	test -e $(DPKG_INSTDIR)/test-file
	test -e $(DPKG_INSTDIR)/test-other
	$(call pkg_is_installed,pkg-divert)
	$(call pkg_is_installed,pkg-replaces)
	$(DPKG_PURGE) pkg-replaces
	$(DPKG_PURGE) pkg-divert
	$(DPKG_PURGE) pkg-files
	! test -e $(DPKG_INSTDIR)/test-file
	! test -e $(DPKG_INSTDIR)/test-other

	# XXX: In the force case, if we purge pkg-replaces last, then it
	# will leave behind on the fsys an unowned file.

test-clean:
	$(DPKG_PURGE) pkg-files pkg-divert pkg-replaces