aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2009-09-25 21:07:26 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2009-09-25 21:07:26 +0000
commite625980d0c4138477193fa40e22078c35a954e0c (patch)
tree272f14bb1b32e49ce9fbb924bbb8f999e649cfbd
parent5525505600906cb23a650af11bd952e6c42e154b (diff)
downloadspec-helper-e625980d0c4138477193fa40e22078c35a954e0c.tar
spec-helper-e625980d0c4138477193fa40e22078c35a954e0c.tar.gz
spec-helper-e625980d0c4138477193fa40e22078c35a954e0c.tar.bz2
spec-helper-e625980d0c4138477193fa40e22078c35a954e0c.tar.xz
spec-helper-e625980d0c4138477193fa40e22078c35a954e0c.zip
code cleanup
-rwxr-xr-xstrip_and_check_elf_files20
1 files changed, 11 insertions, 9 deletions
diff --git a/strip_and_check_elf_files b/strip_and_check_elf_files
index 88d25b6..5f7e84d 100755
--- a/strip_and_check_elf_files
+++ b/strip_and_check_elf_files
@@ -41,19 +41,21 @@ sub strip_files {
}
sub check_missing_or_unused_libs {
- foreach my $f (@shared_libs, @executables) {
- my (undef, undef, @l) = `ldd -u -r $f 2>/dev/null`;
- @l or next;
- my $f_ = substr($f, length($buildroot));
+ my $shift = length($buildroot);
+ foreach my $file (@shared_libs, @executables) {
+ my (undef, undef, @l) = `ldd -u -r $file 2>/dev/null`;
+ next unless @l;
+ my $file_ = substr($file, $shift);
print STDERR
- "Warning: unused libraries in $f_: ",
+ "Warning: unused libraries in $file_: ",
join(' ', map { basename($_) } @l), "\n";
}
- foreach my $f (@shared_libs) {
- my @l = `ldd -r $f 2>&1 >/dev/null` or next;
- my $f_ = substr($f, length($buildroot));
+ foreach my $file (@shared_libs) {
+ my @l = `ldd -r $file 2>&1 >/dev/null`;
+ next unless @l;
+ my $file_ = substr($file, $shift);
print STDERR
- "Warning: undefined symbols in $f_: ",
+ "Warning: undefined symbols in $file_: ",
join(' ', map { /undefined symbol: (\S+)/ ? $1 : () } @l), "\n";
}
}