summaryrefslogtreecommitdiffstats
path: root/ldap/cm/fixBaseInf.pl
diff options
context:
space:
mode:
authorcvsadm <cvsadm>2005-01-21 00:44:34 +0000
committercvsadm <cvsadm>2005-01-21 00:44:34 +0000
commitb2093e3016027d6b5cf06b3f91f30769bfc099e2 (patch)
treecf58939393a9032182c4fbc4441164a9456e82f8 /ldap/cm/fixBaseInf.pl
downloadds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.gz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.xz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.zip
Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)ldapserver7x
Diffstat (limited to 'ldap/cm/fixBaseInf.pl')
-rw-r--r--ldap/cm/fixBaseInf.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/ldap/cm/fixBaseInf.pl b/ldap/cm/fixBaseInf.pl
new file mode 100644
index 00000000..cadbfa74
--- /dev/null
+++ b/ldap/cm/fixBaseInf.pl
@@ -0,0 +1,39 @@
+#
+# BEGIN COPYRIGHT BLOCK
+# Copyright 2001 Sun Microsystems, Inc.
+# Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+
+# the first argument is the full path and filename of ths nsperl.inf file
+# the second argument is the name of the sub component to use
+
+$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: $!";
+
+$inBaseSection = 0;
+while (<IN>) {
+ my $printIt = 1;
+ if ($inBaseSection && /^Archive/) {
+ $printIt = 0; # remove the Archive directives
+ } elsif ($inBaseSection && /^System32Archive/) {
+ $printIt = 0; # remove the Archive directives
+ } elsif ($inBaseSection && /^RestoreFiles/) {
+ $printIt = 0; # these files may not be present
+ }
+ if (/^\[base\]/) {
+ $inBaseSection = 1;
+ } elsif (/^\[/) {
+ $inBaseSection = 0;
+ }
+ print OUT if $printIt;
+}
+
+close OUT;
+close IN;
+
+unlink $infile;
+rename $outfile, $infile;