File: backwardify.pl

package info (click to toggle)
openssl 0.9.8o-4squeeze14
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 25,724 kB
  • ctags: 33,381
  • sloc: ansic: 233,772; perl: 23,990; makefile: 13,204; asm: 9,276; cpp: 4,379; sh: 3,194; lisp: 24
file content (32 lines) | stat: -rw-r--r-- 897 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl
use strict;

# Use as $0
# Use as $0 -noname

my $did_library;
my $did_description;
my $do_exports;
my @imports;
my $noname = (@ARGV and $ARGV[0] eq '-noname' and shift);
while (<>) {
  unless ($did_library) {
    s/\b(cryptssl)\b/crypto/ and $did_library = $1 if /^LIBRARY\s+cryptssl\b/;
    s/\b(open_ssl)\b/ssl/    and $did_library = $1 if /^LIBRARY\s+open_ssl\b/;
  }
  unless ($did_description) {
    s&^(DESCRIPTION\s+(['"])).*&${1}\@#www.openssl.org/:#\@forwarder DLL for pre-0.9.7c+ OpenSSL to the new dll naming scheme$2& and $did_description++;
  }
  if ($do_exports) {{
    last unless /\S/;
    warn, last unless /^ \s* ( \w+ ) \s+ \@(\d+)\s*$/x;
    push @imports, [$1, $2];
    s/$/ NONAME/ if $noname;
  }}
  $do_exports++ if not $do_exports and /^EXPORTS/;
  print $_;
}
print "IMPORTS\n";
for my $imp (@imports) {
  print "\t$imp->[0]=$did_library.$imp->[1]\n";
}