Add SSL_client_version() getter function
[openssl.git] / util / perlpath.pl
1 #! /usr/bin/env perl
2 # Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the OpenSSL license (the "License").  You may not use
5 # this file except in compliance with the License.  You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8
9 # modify the '#!/usr/local/bin/perl'
10 # line in all scripts that rely on perl.
11
12 require "find.pl";
13
14 $#ARGV == 0 || print STDERR "usage: perlpath newpath  (eg /usr/bin)\n";
15 &find(".");
16
17 sub wanted
18         {
19         return unless /\.pl$/ || /^[Cc]onfigur/;
20
21         open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
22         @a=<IN>;
23         close(IN);
24
25         if (-d $ARGV[0]) {
26                 $a[0]="#!$ARGV[0]/perl\n";
27         }
28         else {
29                 $a[0]="#!$ARGV[0]\n";
30         }
31
32         # Playing it safe...
33         $new="$_.new";
34         open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
35         print OUT @a;
36         close(OUT);
37
38         rename($new,$_) || die "unable to rename $dir/$new:$!\n";
39         chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";
40         }