=================================================================== RCS file: /cvs/openbsd/fill_chroot/find_depends,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- openbsd/fill_chroot/find_depends 2008/09/16 23:28:53 1.11 +++ openbsd/fill_chroot/find_depends 2008/09/16 23:38:04 1.12 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $RedRiver: find_depends,v 1.10 2008/09/16 22:15:03 andrew Exp $ +# $RedRiver: find_depends,v 1.11 2008/09/16 22:28:53 andrew Exp $ use strict; use warnings; @@ -68,31 +68,30 @@ foreach (@libs) { my $spec; - if (/\/ld\.so$/) { - $spec = $_; + if ($_ eq $file) { + # We don't want to include the file we are looking in + next; } - else { - if ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) { - $spec = 'l' . $name . '.' . $maj . '.' . $min; + elsif ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) { + $spec = 'l' . $name . '.' . $maj . '.' . $min; + if ($ld->{$spec}) { + $locs->{$spec} = $ld->{$spec}; } } - - next if ! $spec; - next if exists $locs->{$spec}; - - print " Found spec '$spec'\n" if $opts{v}; - - if (-e $spec) { - $locs->{$spec} = $spec; + elsif (-e $_) { + $spec = $_; + $locs->{$spec} = $spec; } else { - $locs->{$spec} = $ld->{$spec}; + next; } if (! $locs->{$spec}) { print STDERR "Couldn't find location for '$_' (file '$file')\n"; next; } + + print " Found '$spec' => '$locs->{$spec}'\n" if $opts{v}; $locs = find_libs($locs->{$spec}, $ld, $locs);