File: maintscript

package info (click to toggle)
debhelper 9.20150101
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,460 kB
  • sloc: perl: 5,757; makefile: 89; sh: 7
file content (19 lines) | stat: -rw-r--r-- 638 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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");