From 3e271c1ecf79fed1c68b63c7ca0ae0f478e2b091 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 23 Feb 2007 17:03:30 +0000 Subject: * fixed bug that caused the architecture detection to fail an 64-bit systems git-svn-id: http://svn.openslx.org/svn/openslx/trunk@714 95ad53e4-c205-0410-b2fa-d234c58c8868 --- bin/slxldd | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/slxldd b/bin/slxldd index 0a3fcb1d..7c578b5d 100755 --- a/bin/slxldd +++ b/bin/slxldd @@ -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 -- cgit v1.2.3-55-g7522