]> git.donarmstrong.com Git - debhelper.git/blob - dh_clean
r146: Initial Import
[debhelper.git] / dh_clean
1 #!/usr/bin/perl -w
2 #
3 # Clean up $TMP and other tepmorary files generated by the 
4 # build process.
5
6 BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
7 use Dh_Lib;
8 init();
9
10 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
11         $TMP=tmpdir($PACKAGE);
12         $EXT=pkgext($PACKAGE);
13
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");
19         
20         doit ("rm","-rf",$TMP);
21 }
22
23 if (@ARGV) {
24         doit("rm","-f","--",@ARGV);
25 }
26
27 if (! $dh{K_FLAG}) {
28         doit("rm","-f","debian/files");
29 }
30
31 # Remove other temp files.
32 # (The \s+ is important, \s won't work because find would get null parameters).
33 # Note that you _don't_ quote wildcards used by find in here.
34 doit(split(/\s+/,"find . ( -name #*# -o -name *~ -o -name DEADJOE
35         -o -name *.orig -o -name *.rej -o -name *.bak
36         -o -name .*.orig -o -name .*.rej -o -name .SUMS
37         -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P )
38         ) -exec rm -f {} ;"));