diff options
Diffstat (limited to 'bin/slxldd')
-rwxr-xr-x | bin/slxldd | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -146,7 +146,7 @@ sub addLib foreach my $folder (@folders) { if (-e "$folder/$lib") { # have library matching name, now check if the platform is ok, too: - my $libFileInfo = `file --dereference $folder/$lib 2>/dev/null`; + my $libFileInfo = `file --dereference --brief $folder/$lib 2>/dev/null`; if ($?) { die _tr("unable to fetch file info for '%s', giving up!\n", $folder/$lib); @@ -177,17 +177,25 @@ sub addLibsForBinary # first do some checks: print STDERR _tr("analyzing '%s'...\n", $binary) if $verbose; my $fileInfo = `file --dereference --brief --mime $binary 2>/dev/null`; - chomp $fileInfo; - print STDERR _tr("\tinfo is: '%s'...\n", $fileInfo) if $verbose; if ($?) { die _tr("unable to fetch file info for $binary, giving up!\n"); } + chomp $fileInfo; + print STDERR _tr("\tinfo is: '%s'...\n", $fileInfo) if $verbose; if ($fileInfo !~ m[^application/(x-executable|x-shared)]i) { # ignore anything that's not an executable or a shared library print STDERR _tr("%s: ignored, as it isn't an executable or a shared library\n", $binary); next; } + # fetch file info again, this time without '--mime' in order to get the architecture + # bitwidth: + $fileInfo = `file --dereference --brief $binary 2>/dev/null`; + if ($?) { + die _tr("unable to fetch file info for $binary, giving up!\n"); + } + chomp $fileInfo; + print STDERR _tr("\tinfo is: '%s'...\n", $fileInfo) if $verbose; my $bitwidth = ($fileInfo =~ m[64-bit]i) ? 64 : 32; # determine whether binary is 32- or 64-bit platform |