[BACK]Return to find_depends CVS log [TXT][DIR] Up to [local] / openbsd / fill_chroot

Diff for /openbsd/fill_chroot/find_depends between version 1.6 and 1.7

version 1.6, 2007/05/16 20:55:42 version 1.7, 2008/04/22 21:08:41
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: find_depends,v 1.5 2005/12/21 19:14:12 andrew Exp $  # $RedRiver: find_depends,v 1.6 2007/05/16 19:55:42 andrew Exp $
 use strict;  use strict;
 use warnings;  use warnings;
   
Line 66 
Line 66 
   
   my @libs = search_file($file);    my @libs = search_file($file);
   foreach (@libs) {    foreach (@libs) {
     my ($name, $maj, $min) = $_ =~ /^([^\.]+)\.so\.(\d+)\.(\d+)$/;      my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/;
     my $spec = 'l' . $name . '.' . $maj . '.' . $min;      my $spec = 'l' . $name . '.' . $maj . '.' . $min;
   
     if (exists $ld->{$spec}) {      if (exists $ld->{$spec}) {
Line 88 
Line 88 
 {  {
   my $file = shift;    my $file = shift;
   my @libs;    my @libs;
   
   open my $libs, '<', $file or die "Couldn't open lib '$file': $!";    open my $libs, '-|', '/usr/bin/ldd', $file or die "Couldn't open ldd '$file': $!";
   local $/ = chr(0);  
   while (<$libs>) {    while (<$libs>) {
     if (m|^(/[^\w\/]+/)?lib(\S+)\.(\d+)\.(\d+)|) {      chomp;
       my ($path, $name, $major, $minor) = ($1, $2, $3, $4);      my $spec = substr $_, 56;
       my $spec="$name.$major.$minor";      next if $spec !~ m{^/}xms;
       if (defined $path && $path ne '/usr/local/lib') {      push @libs, $spec;
         $spec="$path/$spec";  
       }  
       push @libs, $spec;  
     }  
   }    }
   close $libs;    close $libs;
   

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>