=================================================================== RCS file: /cvs/openbsd/fill_chroot/find_depends,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- openbsd/fill_chroot/find_depends 2008/09/16 23:15:03 1.10 +++ openbsd/fill_chroot/find_depends 2008/09/16 23:28:53 1.11 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: find_depends,v 1.9 2008/05/05 19:02:57 andrew Exp $ +# $RedRiver: find_depends,v 1.10 2008/09/16 22:15:03 andrew Exp $ use strict; use warnings; @@ -66,20 +66,36 @@ my @libs = search_file($file); foreach (@libs) { - my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/; - next if ! $name; - my $spec = 'l' . $name . '.' . $maj . '.' . $min; + my $spec; + + if (/\/ld\.so$/) { + $spec = $_; + } + else { + if ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) { + $spec = 'l' . $name . '.' . $maj . '.' . $min; + } + } + + next if ! $spec; + next if exists $locs->{$spec}; + print " Found spec '$spec'\n" if $opts{v}; - if (exists $ld->{$spec}) { - next if exists $locs->{$spec}; + if (-e $spec) { + $locs->{$spec} = $spec; + } + else { + $locs->{$spec} = $ld->{$spec}; + } - $locs->{$spec} = $ld->{$spec}; - $locs = find_libs($ld->{$spec}, $ld, $locs); - - } else { - warn "Couldn't find location for lib '$_' (file '$file')"; + if (! $locs->{$spec}) { + print STDERR "Couldn't find location for '$_' (file '$file')\n"; + next; } + + $locs = find_libs($locs->{$spec}, $ld, $locs); + } return $locs;