dpkg (1.18.25) stretch; urgency=medium
[dpkg] / t-func / deb-content.at
1 AT_TESTED([dpkg-deb])
2
3 AT_SETUP([dpkg-deb .deb conffiles])
4 AT_KEYWORDS([dpkg-deb deb conffiles])
5
6 DPKG_GEN_CONTROL([pkg-conff-dupe])
7 DPKG_GEN_FILE([pkg-conff-dupe], [conffiles], [/test-conffile-1
8 /test-conffile-2
9 /test-conffile-1])
10 AT_DATA([pkg-conff-dupe/test-conffile-1], [test init
11 ])
12 AT_DATA([pkg-conff-dupe/test-conffile-2], [test init
13 ])
14 AT_CHECK([
15 # Duplicate conffile entries should produce a warning.
16 dpkg-deb -b pkg-conff-dupe
17 ], [0], [ignore], [dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated
18 dpkg-deb: warning: ignoring 1 warning about the control file(s)
19 ])
20
21 DPKG_GEN_CONTROL([pkg-conff-noel])
22 printf "/test-conffile-1" >"pkg-conff-noel/DEBIAN/conffiles"
23 AT_DATA([pkg-conff-noel/test-conffile-1], [test init
24 ])
25 AT_CHECK([
26 # Conffiles need a final newline to guarantee there's been no accidental
27 # file truncation.
28 dpkg-deb -b pkg-conff-noel pkg-conff-noel.deb
29 ], [2], [ignore], [dpkg-deb: error: conffile name '/test-conffile-1' is too long, or missing final newline
30 ])
31
32 DPKG_GEN_CONTROL([pkg-deb-newline])
33 touch 'pkg-deb-newline/file
34 newline'
35 AT_CHECK([
36 # Cannot create package with newlines in filenames.
37 dpkg-deb -b pkg-deb-newline
38 ], [2], [ignore], [dpkg-deb: error: newline not allowed in pathname './file
39 newline'
40 ])
41
42 AT_CLEANUP