3 # Clean up $tmp and other tepmorary files generated by the
7 use Debian::Debhelper::Dh_Lib;
10 foreach my $package (@{$dh{DOPACKAGES}}) {
11 my $tmp=tmpdir($package);
12 my $ext=pkgext($package);
15 doit("rm","-f","debian/${ext}substvars",
16 "debian/${ext}postinst.debhelper",
17 "debian/${ext}postrm.debhelper",
18 "debian/${ext}preinst.debhelper",
19 "debian/${ext}prerm.debhelper");
22 doit ("rm","-rf",$tmp);
27 doit("rm","-f","--",@ARGV);
31 doit("rm","-f","debian/files");
34 # See if some files that would normally be deleted are excluded.
36 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
37 $find_options="-a ! ( $dh{EXCLUDE_FIND} )";
40 # Remove other temp files.
41 # (The \s+ is important, \s won't work because find would get null
42 # parameters). Note that you _don't_ quote wildcards used by find
44 doit(split(/\s+/,"find . -type f -a
45 ( -name #*# -o -name *~ -o -name DEADJOE
46 -o -name *.orig -o -name *.rej -o -name *.bak
47 -o -name .*.orig -o -name .*.rej -o -name .SUMS
48 -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P )
49 ) $find_options -exec rm -f {} ;"));
52 doit('rm', '-rf', 'debian/tmp') if -x 'debian/tmp' && ! compat(1);