3 # Copyright (C) 2006, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id: updateopenssl.pl,v 1.11 2009/12/04 21:59:24 marka Exp
20 # This script locates the latest version of OpenSSL in the grandparent
21 # directory and updates the build scripts to use that version.
26 # List of files that need to be updated with the actual version of the
28 @filelist = ("SetupLibs.bat",
29 "../lib/dns/win32/libdns.mak",
30 "../lib/dns/win32/libdns.dsp");
32 # Locate the openssl directory
33 $substr = getdirectory
();
35 print "No directory found\n";
38 print "Found $substr directory\n";
40 #Update the list of files
43 foreach $file (@filelist) {
44 print "Updating file $file\n";
45 updatefile
($file, $substr);
50 # Function to find the
55 opendir(DIR
,$path) || die "No Directory: $!";
56 @namelist = grep (/^openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]$/i, readdir(DIR
));
59 # Make sure we have something
60 if (scalar(@namelist) == 0) {
63 # Now see if we have a directory or just a file.
64 # Make sure we are case insensitive
65 foreach $file (sort {uc($a) cmp uc($b)} @namelist) {
71 # If we have one use it otherwise report the error
72 # Note that we are only interested in the last one
73 # since the sort should have taken care of getting
83 # function to replace the openssl directory name with the latest one
85 my($filename, $substr, $line);
91 open (RFILE
, $filename) || die "Can't open file $filename: $!";
96 foreach $line (@Lines) {
97 $line =~ s/openssl-[0-9]+\.[0-9]+\.[0-9]+[a-z]/$substr/gi;
100 open (RFILE
, ">$filename") || die "Can't open file $filename: $!";
101 foreach $line (@Lines) {