3 # Clean up $TMP and other tepmorary files generated by the
6 use Debian::Debhelper::Dh_Lib;
9 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
10 $TMP=tmpdir($PACKAGE);
11 $EXT=pkgext($PACKAGE);
14 doit("rm","-f","debian/${EXT}substvars",
15 "debian/${EXT}postinst.debhelper",
16 "debian/${EXT}postrm.debhelper",
17 "debian/${EXT}preinst.debhelper",
18 "debian/${EXT}prerm.debhelper");
21 doit ("rm","-rf",$TMP);
26 doit("rm","-f","--",@ARGV);
30 doit("rm","-f","debian/files");
33 # See if some files that would normally be deleted are excluded.
34 if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') {
38 $find_options="-a ! ( $dh{EXCLUDE_FIND} )";
41 # Remove other temp files.
42 # (The \s+ is important, \s won't work because find would get null
43 # parameters). Note that you _don't_ quote wildcards used by find
45 doit(split(/\s+/,"find . -type f -a
46 ( -name #*# -o -name *~ -o -name DEADJOE
47 -o -name *.orig -o -name *.rej -o -name *.bak
48 -o -name .*.orig -o -name .*.rej -o -name .SUMS
49 -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P )
50 ) $find_options -exec rm -f {} ;"));
53 doit('rm', '-rf', 'debian/tmp')
54 if -x 'debian/tmp' && ! Debian::Debhelper::Dh_Lib::compat(1);