1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#! perl
#
# Do a perl check for version >= 5.005. See 'gpt-translate-interpreter' should you
# need to alter the invocation path to a valid perl interpreter in the GPT front-end
# programs.
#
if ( ! ( defined eval "require 5.005" ) )
{
die "GPT requires at least Perl version 5.005";
}
open(FILE, "< $ARGV[0]") or die "Can't open $ARGV[0] for reading: $!\n";
my @filecontents= <FILE>;
my ($libnames, @rest) = grep /^library_names/, @filecontents;
$libnames =~ s/'//g;
$libnames =~ s/\n//g;
my ($ident, $libs)= split /=/, $libnames;
my @sonames = split / /, $libs;
my %seen = ();
my @uniq;
foreach $item (@sonames) {
push(@uniq, $item) unless $seen{$item}++;
}
foreach $soname (@uniq){
chomp $soname;
print "$ARGV[1]/$soname\n";
}
($staticnames, @rest) = grep /^old_library/, @filecontents;
$staticnames =~ s/'//g;
($ident, $staticname)= split /=/, $staticnames;
chomp $staticname;
print "$ARGV[1]/$staticname\n";
print "$ARGV[1]/$ARGV[0]\n";
|