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