[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.7 and 1.12

version 1.7, 2008/04/22 21:08:41 version 1.12, 2008/09/16 23:38:04
Line 1 
Line 1 
 #!/usr/bin/perl  #!/usr/bin/perl
 # $RedRiver: find_depends,v 1.6 2007/05/16 19:55:42 andrew Exp $  # $RedRiver: find_depends,v 1.11 2008/09/16 22:28:53 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) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/;      my $spec;
     my $spec = 'l' . $name . '.' . $maj . '.' . $min;  
       if ($_ eq $file) {
           # We don't want to include the file we are looking in
           next;
       }
       elsif ( my ($name, $maj, $min) = $_ =~ /lib([^\/]+)\.so\.(\d+)\.(\d+)$/ ) {
           $spec = 'l' . $name . '.' . $maj . '.' . $min;
           if ($ld->{$spec}) {
               $locs->{$spec} = $ld->{$spec};
           }
       }
       elsif (-e $_) {
           $spec = $_;
           $locs->{$spec} = $spec;
       }
       else {
           next;
       }
   
     if (exists $ld->{$spec}) {      if (! $locs->{$spec}) {
       next if exists $locs->{$spec};        print STDERR "Couldn't find location for '$_' (file '$file')\n";
         next;
       }
   
       $locs->{$spec} = $ld->{$spec};      print "  Found '$spec' => '$locs->{$spec}'\n" if $opts{v};
   
       $locs = find_libs($locs->{$spec}, $ld, $locs);      $locs = find_libs($locs->{$spec}, $ld, $locs);
   
     } else {  
       warn "Couldn't find location for lib '$_' (file '$file')";  
     }  
   }    }
   
   return $locs;    return $locs;
Line 92 
Line 108 
   open my $libs, '-|', '/usr/bin/ldd', $file or die "Couldn't open ldd '$file': $!";    open my $libs, '-|', '/usr/bin/ldd', $file or die "Couldn't open ldd '$file': $!";
   while (<$libs>) {    while (<$libs>) {
     chomp;      chomp;
     my $spec = substr $_, 56;      my ($spec) = (split(/\s+/, $_))[7];
       next if ! $spec;
     next if $spec !~ m{^/}xms;      next if $spec !~ m{^/}xms;
     push @libs, $spec;      push @libs, $spec;
   }    }

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

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