diff options
Diffstat (limited to 'src/lib/libcrypto/util/up_ver.pl')
-rw-r--r-- | src/lib/libcrypto/util/up_ver.pl | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/up_ver.pl b/src/lib/libcrypto/util/up_ver.pl new file mode 100644 index 0000000000..32c086b2aa --- /dev/null +++ b/src/lib/libcrypto/util/up_ver.pl | |||
@@ -0,0 +1,79 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # | ||
3 | # Up the version numbers in the files. | ||
4 | # | ||
5 | |||
6 | @files=( | ||
7 | "crypto/crypto.h", | ||
8 | "crypto/des/ecb_enc.c", | ||
9 | "crypto/idea/i_ecb.c", | ||
10 | "crypto/lhash/lhash.c", | ||
11 | "crypto/conf/conf.c", | ||
12 | "crypto/md2/md2_dgst.c", | ||
13 | "crypto/md5/md5_dgst.c", | ||
14 | "crypto/ripemd/rmd_dgst.c", | ||
15 | "crypto/pem/pem_lib.c", | ||
16 | "crypto/bn/bn_lib.c", | ||
17 | "crypto/dh/dh_lib.c", | ||
18 | "crypto/rc2/rc2_ecb.c", | ||
19 | "crypto/rc4/rc4_skey.c", | ||
20 | "crypto/rc5/rc5_ecb.c", | ||
21 | "crypto/bf/bf_ecb.c", | ||
22 | "crypto/cast/c_ecb.c", | ||
23 | "crypto/rsa/rsa_lib.c", | ||
24 | "crypto/dsa/dsa_lib.c", | ||
25 | "crypto/sha/sha1dgst.c", | ||
26 | "crypto/sha/sha_dgst.c", | ||
27 | "crypto/asn1/asn1_lib.c", | ||
28 | "crypto/x509/x509_vfy.c", | ||
29 | "crypto/evp/evp_enc.c", | ||
30 | "crypto/rand/md_rand.c", | ||
31 | "crypto/stack/stack.c", | ||
32 | "crypto/txt_db/txt_db.c", | ||
33 | "crypto/cversion.c", | ||
34 | "ssl/ssl_lib.c", | ||
35 | "ssl/s2_lib.c", | ||
36 | "ssl/s3_lib.c", | ||
37 | "ssl/t1_lib.c", | ||
38 | "README", | ||
39 | ); | ||
40 | |||
41 | @month=('Jan','Feb','Mar','Apr','May','Jun', | ||
42 | 'Jul','Aug','Sep','Oct','Nov','Dec'); | ||
43 | @a=localtime(time()); | ||
44 | $time=sprintf("%02d-%s-%04d",$a[3],$month[$a[4]],$a[5]+1900); | ||
45 | |||
46 | $ver=$ARGV[0]; | ||
47 | ($ver ne "") || die "no version number specified\n"; | ||
48 | ($a,$b,$c,$d)=unpack('axaxac',$ver); | ||
49 | $d=defined($d)?$d-96:0; | ||
50 | $xver=sprintf("%x%x%x%x",$a,$b,$c,$d); | ||
51 | |||
52 | foreach $file (@files) | ||
53 | { | ||
54 | open(IN,"<$file") || die "unable to open $file:$!\n"; | ||
55 | open(OUT,">$file.new") || die "unable to open $file.new:$!\n"; | ||
56 | $found=0; | ||
57 | |||
58 | print STDERR "$file:"; | ||
59 | |||
60 | while (<IN>) | ||
61 | { | ||
62 | if ((s/SSLeay \d\.\d.\d[^"]*(\"|\s)/SSLeay $ver $time\1/) || | ||
63 | s/^(\#define\s+SSLEAY_VERSION_NUMBER\s+0x)[0-9a-zA-Z]+(.*)$/$1$xver$2/) | ||
64 | { | ||
65 | print STDERR " Done"; | ||
66 | $found++; | ||
67 | print OUT; | ||
68 | while (<IN>) { print OUT; } | ||
69 | last; | ||
70 | } | ||
71 | print OUT; | ||
72 | } | ||
73 | print STDERR "\n"; | ||
74 | close(IN); | ||
75 | close(OUT); | ||
76 | (!$found) && die "unable to update the version number in $file\n"; | ||
77 | rename($file,"$file.old") || die "unable to rename $file:$!\n"; | ||
78 | rename("$file.new",$file) || die "unable to rename $file.new:$!\n"; | ||
79 | } | ||