2 pkg-dir-conffile-0 pkg-dir-conffile-1 \
3 pkg-dir-file-other pkg-dir-symlink-int-0 pkg-dir-symlink-int-1 \
4 pkg-dir-file-moved pkg-dir-symlink-ext-0 pkg-dir-symlink-ext-1
9 ln
-sfT test-dir pkg-dir-conffile-1
/test-path
10 ln
-sfT test-dir pkg-dir-symlink-ext-1
/test-path
11 ln
-sfT test-dir pkg-dir-symlink-int-1
/test-path
14 $(RM
) pkg-dir-conffile-1
/test-path
15 $(RM
) pkg-dir-symlink-ext-1
/test-path
16 $(RM
) pkg-dir-symlink-int-1
/test-path
19 # Cannot switch a directory containing conffiles
20 $(DPKG_INSTALL
) pkg-dir-conffile-0.deb
21 test -d
'$(DPKG_INSTDIR)/test-path'
22 ! $(DPKG_INSTALL
) pkg-dir-conffile-1.deb
23 test -d
'$(DPKG_INSTDIR)/test-path'
24 $(DPKG_PURGE
) pkg-dir-conffile
26 # Cannot switch a directory containing files owned by another package
27 $(DPKG_INSTALL
) pkg-dir-file-other.deb
28 $(DPKG_INSTALL
) pkg-dir-symlink-int-0.deb
29 test -d
'$(DPKG_INSTDIR)/test-path'
30 ! test -h
'$(DPKG_INSTDIR)/test-path'
31 ! $(DPKG_INSTALL
) pkg-dir-symlink-int-1.deb
32 test -d
'$(DPKG_INSTDIR)/test-path'
33 ! test -h
'$(DPKG_INSTDIR)/test-path'
34 $(DPKG_PURGE
) pkg-dir-symlink-int
35 $(DPKG_PURGE
) pkg-dir-file-other
37 # Cannot switch a directory containing local files
38 $(DPKG_INSTALL
) pkg-dir-symlink-int-0.deb
39 test -d
'$(DPKG_INSTDIR)/test-path'
40 ! test -h
'$(DPKG_INSTDIR)/test-path'
41 touch
'$(DPKG_INSTDIR)/test-path/local file'
42 ! $(DPKG_INSTALL
) pkg-dir-symlink-int-1.deb
43 test -d
'$(DPKG_INSTDIR)/test-path'
44 ! test -h
'$(DPKG_INSTDIR)/test-path'
45 rm '$(DPKG_INSTDIR)/test-path/local file'
46 $(DPKG_PURGE
) pkg-dir-symlink-int
49 # Otherwise allow the switch
52 # Switch a directory to a symlink, contents moved within the package,
53 # with intermediate full installs.
54 $(DPKG_INSTALL
) pkg-dir-symlink-int-0.deb
55 test -d
'$(DPKG_INSTDIR)/test-path'
56 ! test -h
'$(DPKG_INSTDIR)/test-path'
57 $(DPKG_INSTALL
) pkg-dir-symlink-int-1.deb
58 test -h
'$(DPKG_INSTDIR)/test-path'
59 $(DPKG_PURGE
) pkg-dir-symlink-int
60 ! test -e
'$(DPKG_INSTDIR)/test-path'
62 # Switch a directory to a symlink, contents moved within the package,
63 # with full install, upgrade with upack and configure.
64 $(DPKG_INSTALL
) pkg-dir-symlink-int-0.deb
65 ! test -h
'$(DPKG_INSTDIR)/test-path'
66 test -d
'$(DPKG_INSTDIR)/test-path'
67 $(DPKG_UNPACK
) pkg-dir-symlink-int-1.deb
68 ! test -h
'$(DPKG_INSTDIR)/test-path'
69 test -d
'$(DPKG_INSTDIR)/test-path'
70 $(DPKG_CONFIGURE
) pkg-dir-symlink-int
71 test -h
'$(DPKG_INSTDIR)/test-path'
72 $(DPKG_PURGE
) pkg-dir-symlink-int
73 ! test -e
'$(DPKG_INSTDIR)/test-path'
75 # Switch a directory to a symlink, contents moved within the package,
76 # with two unpacks and configure.
77 $(DPKG_UNPACK
) pkg-dir-symlink-int-0.deb
78 ! test -h
'$(DPKG_INSTDIR)/test-path'
79 $(DPKG_UNPACK
) pkg-dir-symlink-int-1.deb
80 ! test -h
'$(DPKG_INSTDIR)/test-path'
81 test -d
'$(DPKG_INSTDIR)/test-path'
82 $(DPKG_CONFIGURE
) pkg-dir-symlink-int
83 test -h
'$(DPKG_INSTDIR)/test-path'
84 $(DPKG_PURGE
) pkg-dir-symlink-int
85 ! test -e
'$(DPKG_INSTDIR)/test-path'
87 # Switch a directory to a symlink, contents moved to another package,
88 # with intermediate full installs.
89 $(DPKG_INSTALL
) pkg-dir-symlink-ext-0.deb
90 test -d
'$(DPKG_INSTDIR)/test-path'
91 $(DPKG_INSTALL
) pkg-dir-file-moved.deb
92 test -d
'$(DPKG_INSTDIR)/test-path'
93 test -d
'$(DPKG_INSTDIR)/test-dir'
94 $(DPKG_INSTALL
) pkg-dir-symlink-ext-1.deb
95 test -h
'$(DPKG_INSTDIR)/test-path'
96 test "`readlink -f '$(DPKG_INSTDIR)/test-path'`" = "/test-dir"
97 ! test -h
'$(DPKG_INSTDIR)/test-dir'
98 test -d
'$(DPKG_INSTDIR)/test-dir'
99 test -f
'$(DPKG_INSTDIR)/test-dir/file-normal'
100 $(DPKG_PURGE
) pkg-dir-symlink-ext
101 $(DPKG_PURGE
) pkg-dir-file-moved
103 # Switch a directory to a symlink, contents moved to another package,
104 # with full installs, upgrade with upack and configure.
105 $(DPKG_INSTALL
) pkg-dir-symlink-ext-0.deb
106 test -d
'$(DPKG_INSTDIR)/test-path'
107 $(DPKG_INSTALL
) pkg-dir-file-moved.deb
108 test -d
'$(DPKG_INSTDIR)/test-path'
109 test -d
'$(DPKG_INSTDIR)/test-dir'
110 $(DPKG_UNPACK
) pkg-dir-symlink-ext-1.deb
111 test -d
'$(DPKG_INSTDIR)/test-path'
112 test -d
'$(DPKG_INSTDIR)/test-dir'
114 test -h
'$(DPKG_INSTDIR)/test-path'
115 test "`readlink -f '$(DPKG_INSTDIR)/test-path'`" = "/test-dir"
116 ! test -h
'$(DPKG_INSTDIR)/test-dir'
117 test -d
'$(DPKG_INSTDIR)/test-dir'
118 test -f
'$(DPKG_INSTDIR)/test-dir/file-normal'
119 $(DPKG_PURGE
) pkg-dir-symlink-ext
120 $(DPKG_PURGE
) pkg-dir-file-moved
122 # Switch a directory to a symlink, contents moved to another package,
123 # with three unpacks and configure.
124 $(DPKG_UNPACK
) pkg-dir-symlink-ext-0.deb
125 test -d
'$(DPKG_INSTDIR)/test-path'
126 $(DPKG_UNPACK
) pkg-dir-file-moved.deb
127 test -d
'$(DPKG_INSTDIR)/test-path'
128 test -d
'$(DPKG_INSTDIR)/test-dir'
129 $(DPKG_UNPACK
) pkg-dir-symlink-ext-1.deb
130 test -d
'$(DPKG_INSTDIR)/test-path'
131 test -d
'$(DPKG_INSTDIR)/test-dir'
133 test -h
'$(DPKG_INSTDIR)/test-path'
134 test "`readlink -f '$(DPKG_INSTDIR)/test-path'`" = "/test-dir"
135 ! test -h
'$(DPKG_INSTDIR)/test-dir'
136 test -d
'$(DPKG_INSTDIR)/test-dir'
137 test -f
'$(DPKG_INSTDIR)/test-dir/file-normal'
138 $(DPKG_PURGE
) pkg-dir-symlink-ext
139 $(DPKG_PURGE
) pkg-dir-file-moved
142 $(DPKG_PURGE
) pkg-dir-conffile
143 $(DPKG_PURGE
) pkg-dir-symlink-int
144 $(DPKG_PURGE
) pkg-dir-symlink-ext
145 $(DPKG_PURGE
) pkg-dir-file-other
146 $(DPKG_PURGE
) pkg-dir-file-moved