summaryrefslogtreecommitdiffstats
path: root/ldap/cm/fixPerlDAPInf.pl
blob: cf1f9fb71549233d6fddae31744f209b5b2b7fb6 (plain)
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
#
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
#

# the argument is the full path and filename of the perldap.inf file

$infile = $ARGV[0];
$outfile = $ARGV[0] . ".tmp";
open(IN, $infile) or die "Error: could not read file $infile: $!";
open(OUT, ">$outfile") or die "Error: could not write file $outfile: $!";

while (<IN>) {
  if (/^Description/) {
	s/The Sun \| Netscape Alliance/Netscape/g;
	s/iPlanet/Netscape/g;
  } elsif (/^Vendor/) {
	s/Sun \| Netscape Alliance/Netscape Communications Corp./g;
  }
  print OUT;
  if (/^Archive=perldap14.zip/) {
    print OUT "Visible=FALSE\n";
  }
}

close OUT;
close IN;

unlink $infile;
rename $outfile, $infile;