aboutsummaryrefslogtreecommitdiffstats
path: root/clean_files
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2008-01-29 21:34:54 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2008-01-29 21:34:54 +0000
commit02e14506ac57f50b8fe77c79ae72be0403d52b2c (patch)
tree10ba2860acf8f4b7f38af9d22838f43ad358c0ec /clean_files
parent7d1cb2c537e76a8408355a62f38016ed3a8c2085 (diff)
downloadspec-helper-02e14506ac57f50b8fe77c79ae72be0403d52b2c.tar
spec-helper-02e14506ac57f50b8fe77c79ae72be0403d52b2c.tar.gz
spec-helper-02e14506ac57f50b8fe77c79ae72be0403d52b2c.tar.bz2
spec-helper-02e14506ac57f50b8fe77c79ae72be0403d52b2c.tar.xz
spec-helper-02e14506ac57f50b8fe77c79ae72be0403d52b2c.zip
sanitize usage and test of buildroot env var
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