aboutsummaryrefslogtreecommitdiffstats
path: root/clean_files
blob: 2e7723edc655d84830fcffcea4571510670a39ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl
#---------------------------------------------------------------
# Project         : Linux-Mandrake
# Module          : spec-helper
# File            : clean_files
# Version         : $Id$
# Author          : Frederic Lepied
# Created On      : Thu Feb 10 10:29:18 2000
# Purpose         : remove backup files.
#---------------------------------------------------------------

################################################################################
use strict;
use warnings;
$ENV{DONT_CLEANUP} and exit(0);

my $buildroot = $ENV{RPM_BUILD_ROOT};
die "No build root defined" unless $buildroot;
die "Invalid build root" unless -d $buildroot;
chdir($buildroot) or die "Can't cd to $buildroot: $!";

system(split(/\s+/, "find . -type f -a
	        ( -name #*# -o -name *~ -o -name DEADJOE -o -name .cvsignore
		 -o -name *.orig -o -name *.rej -o -name *.bak
		 -o -name .*.orig -o -name .*.rej -o -name .SUMS
		 -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P )
		) -exec rm -f {} ;"));

system("find . -type d -a -name CVS | xargs rm -rf");

# clean_files ends here