Update of /cvsroot/fink/experimental/thesin/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv20916

Added Files:
        cksymbols 
Log Message:
small perl script to get symbols, the pkg and how they are refered to

--- NEW FILE: cksymbols ---
#!/usr/bin/perl

$| = 1;

use strict;
use warnings;

my ($dir, $progname, $symbols);

# Set name of current program
($progname = $0) =~ s#.*/##;

unless ($ARGV[0] && $ARGV[1]) {
  print "Usage: $progname <dir> <symbols>\n";
  print "   ie: $progname /usr/lib \'_des_ede3_cbc_encrypt|_des_set_odd_parity\'\n";
  exit(1);
} else {
  $dir = $ARGV[0];
  $symbols = $ARGV[1];
}

my $grepcmd = "grep -Er '$symbols' $dir";
my $nmcmd = "nm";
my $grepnmcmd = "grep -E '$symbols'";
my $dpkgcmd = "dpkg -S";

my (@matches, $match, @output, $line, $deb);

print "Searching <$dir> for <\'$symbols\'>...\n\n";

@matches = `$grepcmd`;

foreach $match (@matches) {
  if ($match =~ /Binary file (.+) matches/i) {
    $match = $1;
  }
  $deb = `$dpkgcmd $match`;
  if ($deb =~ /^(.+): .*$/i) {
    $deb = $1;
  }
  print "$match ($deb):\n";
  @output = `$nmcmd $match | $grepnmcmd`;
  foreach $line (@output) {
    chomp($line);
    if ($line) {
      print "\t$line\n";
    }
  }
  print "\n";
}

exit(0);




-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Fink-commits mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to