aboutsummaryrefslogtreecommitdiffstats
path: root/strip_files
diff options
context:
space:
mode:
Diffstat (limited to 'strip_files')
-rwxr-xr-xstrip_files8
1 files changed, 5 insertions, 3 deletions
diff --git a/strip_files b/strip_files
index b994362..03bd460 100755
--- a/strip_files
+++ b/strip_files
@@ -64,11 +64,13 @@ sub testfile() {
}
################################################################################
-my $RPM_BUILD_ROOT = $ENV{RPM_BUILD_ROOT};
-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: $!";
@shared_libs = @executables = @static_libs = ();
-find(\&testfile, $RPM_BUILD_ROOT);
+find(\&testfile, $buildroot);
# Note that all calls to strip on shared libs *must* include the --strip-unneeded.
system("strip", "--remove-section=.comment", "--remove-section=.note", "--strip-unneeded",$_) foreach @shared_libs;