1 AT_SETUP([dpkg-deb .deb conffiles])
2 AT_KEYWORDS([dpkg-deb deb conffiles])
4 DPKG_GEN_CONTROL([pkg-conff-duped])
5 DPKG_GEN_CTRL_FILE([pkg-conff-duped], [conffiles], [/test-conffile-1
8 AT_DATA([pkg-conff-duped/test-conffile-1], [test init
10 AT_DATA([pkg-conff-duped/test-conffile-2], [test init
13 # Duplicate conffile entries should produce a warning.
14 dpkg-deb -b pkg-conff-duped
15 ], [0], [ignore], [dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated
16 dpkg-deb: warning: ignoring 1 warning about the control file(s)
19 DPKG_GEN_CONTROL([pkg-conff-noeol])
20 printf "/test-conffile-1" >"pkg-conff-noeol/DEBIAN/conffiles"
21 AT_DATA([pkg-conff-noeol/test-conffile-1], [test init
24 # Conffiles need a final newline to guarantee there's been no accidental
26 dpkg-deb -b pkg-conff-noeol pkg-conff-noeol.deb
27 ], [2], [ignore], [dpkg-deb: error: conffile name '/test-conffile-1' is too long, or missing final newline
30 DPKG_GEN_CONTROL([pkg-conff-noabs])
31 DPKG_GEN_CTRL_FILE([pkg-conff-noabs], [conffiles], [test-conffile-rel])
32 AT_DATA([pkg-conff-noabs/test-conffile-rel], [test init
35 # Conffiles must use absolute pathnames.
36 dpkg-deb -b pkg-conff-noabs pkg-conff-noabs.deb
37 ], [2], [ignore], [dpkg-deb: error: conffile name 'test-conffile-rel' is not an absolute pathname
40 DPKG_GEN_CONTROL([pkg-conff-empty])
41 printf " \n" >"pkg-conff-empty/DEBIAN/conffiles"
43 # Conffiles must not contain empty lines.
44 dpkg-deb -b pkg-conff-empty pkg-conff-empty.deb
45 ], [2], [ignore], [dpkg-deb: error: empty and whitespace-only lines are not allowed in conffiles
48 DPKG_GEN_CONTROL([pkg-conff-space-prefix])
49 DPKG_GEN_CTRL_FILE([pkg-conff-space-prefix], [conffiles], [ /test-conffile])
51 # Conffiles must not contain prefixed spaces.
52 dpkg-deb -b pkg-conff-space-prefix pkg-conff-space-prefix.deb
53 ], [2], [ignore], [dpkg-deb: error: line with conffile filename '/test-conffile' has leading white spaces
56 DPKG_GEN_CONTROL([pkg-conff-unknown-flag])
57 DPKG_GEN_CTRL_FILE([pkg-conff-unknown-flag], [conffiles], [unknown-flag /test-conffile])
59 # Conffiles marked with an unknown flag.
60 dpkg-deb -b pkg-conff-unknown-flag pkg-conff-unknown-flag.deb
61 ], [2], [ignore], [dpkg-deb: error: unknown flag 'unknown-flag' for conffile '/test-conffile'
64 DPKG_GEN_CONTROL([pkg-conff-missing-pathname])
65 printf "unknown-flag \n" >"pkg-conff-missing-pathname/DEBIAN/conffiles"
67 # Conffiles need a pathname, in addition to a flag.
68 dpkg-deb -b pkg-conff-missing-pathname pkg-conff-missing-pathname.deb
69 ], [2], [ignore], [dpkg-deb: error: conffile name missing after flag 'unknown-flag'
72 DPKG_GEN_CONTROL([pkg-conff-removed-missing])
73 DPKG_GEN_CTRL_FILE([pkg-conff-removed-missing], [conffiles], [remove-on-upgrade /test-conffile-missing])
75 # Conffiles marked for removal must not be present.
76 dpkg-deb -b pkg-conff-removed-missing pkg-conff-removed-missing.deb
79 DPKG_GEN_CONTROL([pkg-conff-removed-duped])
80 DPKG_GEN_CTRL_FILE([pkg-conff-removed-duped], [conffiles], [remove-on-upgrade /test-conffile-1
81 remove-on-upgrade /test-conffile-2
82 remove-on-upgrade /test-conffile-1])
84 # Duplicate conffile entries should produce a warning.
85 dpkg-deb -b pkg-conff-removed-duped
86 ], [0], [ignore], [dpkg-deb: warning: conffile name '/test-conffile-1' is duplicated
87 dpkg-deb: warning: ignoring 1 warning about the control file(s)
90 DPKG_GEN_CONTROL([pkg-conff-removed-noeol])
91 printf "remove-on-upgrade /test-conffile-1" >"pkg-conff-removed-noeol/DEBIAN/conffiles"
93 # Conffiles need a final newline to guarantee there has been no accidental
95 dpkg-deb -b pkg-conff-removed-noeol pkg-conff-removed-noeol.deb
96 ], [2], [ignore], [dpkg-deb: error: conffile name 'remove-on-upgrade /test-conffile-1' is too long, or missing final newline
99 DPKG_GEN_CONTROL([pkg-conff-removed-noabs])
100 DPKG_GEN_CTRL_FILE([pkg-conff-removed-noabs], [conffiles], [remove-on-upgrade test-conffile-rel])
101 AT_DATA([pkg-conff-removed-noabs/test-conffile-rel], [test init
104 # Conffiles must use absolute pathnames.
105 dpkg-deb -b pkg-conff-removed-noabs pkg-conff-removed-noabs.deb
106 ], [2], [ignore], [dpkg-deb: error: conffile name 'test-conffile-rel' is not an absolute pathname
109 DPKG_GEN_CONTROL([pkg-conff-removed-present])
110 DPKG_GEN_CTRL_FILE([pkg-conff-removed-present], [conffiles], [remove-on-upgrade /test-conffile-present])
111 AT_DATA([pkg-conff-removed-present/test-conffile-present], [test init
114 # Conffiles marked for removal must not be present.
115 dpkg-deb -b pkg-conff-removed-present pkg-conff-removed-present.deb
116 ], [2], [ignore], [dpkg-deb: error: conffile '/test-conffile-present' is present but is requested to be removed
119 DPKG_GEN_CONTROL([pkg-deb-newline])
120 touch 'pkg-deb-newline/file
123 # Cannot create package with newlines in filenames.
124 dpkg-deb -b pkg-deb-newline
125 ], [2], [ignore], [dpkg-deb: error: newline not allowed in pathname './file