diff options
author | Rich Salz <rsalz@openssl.org> | 2017-05-02 21:38:37 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-05-03 20:16:58 +0200 |
commit | 199b24606103e82bc3d37935fb06a7fbd58f90c2 (patch) | |
tree | e3d9b90d822129dd12b9a83b992d02c39374ed2d /util | |
parent | Perltidy ck_errf (diff) | |
download | openssl-199b24606103e82bc3d37935fb06a7fbd58f90c2.tar.xz openssl-199b24606103e82bc3d37935fb06a7fbd58f90c2.zip |
Run perltidy, use strict+warnings on mkrc.pl
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3368)
Diffstat (limited to 'util')
-rwxr-xr-x | util/mkrc.pl | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/util/mkrc.pl b/util/mkrc.pl index c177349c13..8f8f4f11a7 100755 --- a/util/mkrc.pl +++ b/util/mkrc.pl @@ -6,36 +6,41 @@ # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html +use strict; +use warnings; use lib "."; use configdata; use File::Spec::Functions; -my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h"); +my $versionfile = catfile( $config{sourcedir}, "include/openssl/opensslv.h" ); + +my ( $ver, $v1, $v2, $v3, $v4, $beta, $version ); open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n"; -while(<FD>) { +while (<FD>) { if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) { - $ver = hex($1); - $v1 = ($ver>>28); - $v2 = ($ver>>20)&0xff; - $v3 = ($ver>>12)&0xff; - $v4 = ($ver>> 4)&0xff; - $beta = $ver&0xf; - $version = "$v1.$v2.$v3"; - if ($beta==0xf) { $version .= chr(ord('a')+$v4-1) if ($v4); } - elsif ($beta==0){ $version .= "-dev"; } - else { $version .= "-beta$beta"; } - last; + $ver = hex($1); + $v1 = ( $ver >> 28 ); + $v2 = ( $ver >> 20 ) & 0xff; + $v3 = ( $ver >> 12 ) & 0xff; + $v4 = ( $ver >> 4 ) & 0xff; + $beta = $ver & 0xf; + $version = "$v1.$v2.$v3"; + if ( $beta == 0xf ) { $version .= chr( ord('a') + $v4 - 1 ) if ($v4); } + elsif ( $beta == 0 ) { $version .= "-dev"; } + else { $version .= "-beta$beta"; } + last; } } close(FD); -$filename = $ARGV[0]; $filename =~ /(.*)\.([^.]+)$/; -$basename = $1; -$extname = $2; +my $filename = $ARGV[0]; +$filename =~ /(.*)\.([^.]+)$/; +my $basename = $1; +my $extname = $2; -if ($extname =~ /dll/i) { $description = "OpenSSL shared library"; } -else { $description = "OpenSSL application"; } +my $description = "OpenSSL application"; +$description = "OpenSSL shared library" if $extname =~ /dll/i; print <<___; #include <winver.h> |