PR: 2786
[mirror-openssl.git] / VMS / VMSify-conf.pl
blobd3be6a29e7f43ff071446d94f3b6286f049d3973
1 #! /usr/bin/perl
3 use strict;
4 use warnings;
6 my @directory_vars = ( "dir", "certs", "crl_dir", "new_certs_dir" );
7 my @file_vars = ( "database", "certificate", "serial", "crlnumber",
8 "crl", "private_key", "RANDFILE" );
9 while(<STDIN>) {
10 chomp;
11 foreach my $d (@directory_vars) {
12 if (/^(\s*\#?\s*${d}\s*=\s*)\.\/([^\s\#]*)([\s\#].*)$/) {
13 $_ = "$1sys\\\$disk:\[.$2$3";
14 } elsif (/^(\s*\#?\s*${d}\s*=\s*)(\w[^\s\#]*)([\s\#].*)$/) {
15 $_ = "$1sys\\\$disk:\[.$2$3";
17 s/^(\s*\#?\s*${d}\s*=\s*\$\w+)\/([^\s\#]*)([\s\#].*)$/$1.$2\]$3/;
18 while(/^(\s*\#?\s*${d}\s*=\s*(\$\w+\.|sys\\\$disk:\[\.)[\w\.]+)\/([^\]]*)\](.*)$/) {
19 $_ = "$1.$3]$4";
22 foreach my $f (@file_vars) {
23 s/^(\s*\#?\s*${f}\s*=\s*)\.\/(.*)$/$1sys\\\$disk:\[\/$2/;
24 while(/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+\/[^\s\#]*)([\s\#].*)$/) {
25 $_ = "$1.$3$4";
27 if (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/(\w+)([\s\#].*)$/) {
28 $_ = "$1]$3.$4";
29 } elsif (/^(\s*\#?\s*${f}\s*=\s*(\$\w+|sys\\\$disk:\[)[^\/]*)\/([^\s\#]*)([\s\#].*)$/) {
30 $_ = "$1]$3$4";
33 print $_,"\n";