aboutsummaryrefslogtreecommitdiffstats
path: root/clean_files
diff options
context:
space:
mode:
Diffstat (limited to 'clean_files')
-rwxr-xr-xclean_files7
1 files changed, 4 insertions, 3 deletions
diff --git a/clean_files b/clean_files
index 7e5d02d..2e7723e 100755
--- a/clean_files
+++ b/clean_files
@@ -14,9 +14,10 @@ use strict;
use warnings;
$ENV{DONT_CLEANUP} and exit(0);
-my $RPM_BUILD_ROOT = $ENV{RPM_BUILD_ROOT};
-$RPM_BUILD_ROOT or exit(0); # case RPM_BUILD_ROOT is not used
-chdir($RPM_BUILD_ROOT) or die "Can't cd to $ENV{RPM_BUILD_ROOT}: $!";
+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