diff options
author | Joey Hess <joey@kitenet.net> | 2010-11-02 16:24:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-11-02 16:24:04 -0400 |
commit | 4c8f8cd25e912508731e3494d3ee303bccf0001e (patch) | |
tree | 28eb1a4ce85f1ecd39a7e86295fb892d41b01fec /t | |
parent | a9116a731fb4baf4873e5693681c3602bbeee6a3 (diff) |
maintscript files
dh_installdeb: Support debian/package.maintscript files, which can contain
dpkg-maintscript-helper commands. This can be used to automate moving or
removing conffiles, or anything added to dpkg-maintscript-helper later on.
Closes: #574443 (Thanks, Colin Watson)
Diffstat (limited to 't')
-rw-r--r-- | t/maintscript | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/maintscript b/t/maintscript new file mode 100644 index 00000000..bf15d445 --- /dev/null +++ b/t/maintscript @@ -0,0 +1,19 @@ +#!/usr/bin/perl +use Test; +plan(tests => 8); + +system("mkdir -p t/tmp/debian"); +system("cp debian/control t/tmp/debian"); +open(OUT, ">", "t/tmp/debian/maintscript") || die "$!"; +print OUT <<EOF; +rm_conffile /etc/1 +mv_conffile /etc/2 /etc/3 1.0-1 +EOF +close OUT; +system("cd t/tmp && DH_COMPAT=7 fakeroot ../../dh_installdeb"); +for my $script (qw{postinst preinst prerm postrm}) { + my @output=`cat t/tmp/debian/debhelper.$script.debhelper`; + ok(grep { m{^dpkg-maintscript-helper rm_conffile /etc/1 -- "\$\@"$} } @output); + ok(grep { m{^dpkg-maintscript-helper mv_conffile /etc/2 /etc/3 1\.0-1 -- "\$\@"$} } @output); +} +system("rm -rf t/tmp"); |