Generated with git diff d4ab9038a19188132d12321d0f26a9e2f2cce581..HEAD $(git diff --name-only d4ab9038a19188132d12321d0f26a9e2f2cce581..HEAD | fgrep -v .gitignore) > Crypt-OpenSSL-X509-1.807-various.patch where HEAD is eb169806c23e0dd18e6178d72b73a698082cc115 diff --git a/META.yml b/META.yml index 1de58fe..db3e048 100644 --- a/META.yml +++ b/META.yml @@ -8,7 +8,7 @@ configure_requires: ExtUtils::MakeMaker: 6.36 distribution_type: module dynamic_config: 1 -generated_by: 'Module::Install version 1.06' +generated_by: 'Module::Install version 1.16' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -19,10 +19,10 @@ no_index: - inc - t requires: - perl: 5.005 + perl: '5.005' resources: bugtracker: https://github.com/dsully/perl-crypt-openssl-x509/issues homepage: https://github.com/dsully/perl-crypt-openssl-x509 license: http://dev.perl.org/licenses/ repository: https://github.com/dsully/perl-crypt-openssl-x509 -version: 1.804 +version: '1.807' diff --git a/Makefile.PL b/Makefile.PL index d16a17d..9708e74 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,17 +13,16 @@ bugtracker 'https://github.com/dsully/perl-crypt-openssl-x509/issues'; requires_external_cc(); - inc '-I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include'; - - libs '-L/usr/lib -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto'; - - if ($Config::Config{myuname} =~ /darwin/i) { - cc_optimize_flags('-O2 -g -Wall -Werror -Wno-deprecated-declarations'); - } elsif ($Config::Config{myuname} =~ /sunos|solaris/i) { - # Any SunStudio flags? - } else { - cc_optimize_flags('-O2 -g -Wall -Werror'); - } +inc '-I/usr/local/opt/openssl/include -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include'; +libs '-L/usr/local/opt/openssl/lib -L/usr/lib -L/usr/local/lib -L/usr/local/ssl/lib -lcrypto -lssl'; + +if ($Config::Config{myuname} =~ /darwin/i) { + cc_optimize_flags('-O2 -g -Wall -Werror -Wno-deprecated-declarations'); +} elsif ($Config::Config{myuname} =~ /sunos|solaris/i) { + # Any SunStudio flags? +} else { + cc_optimize_flags('-O2 -g -Wall -Werror'); +} auto_install(); WriteAll(); diff --git a/X509.pm b/X509.pm index 538679d..c8c17ad 100644 --- a/X509.pm +++ b/X509.pm @@ -8,7 +8,7 @@ use base qw(Exporter); $VERSION = '1.807'; @EXPORT_OK = qw( - FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM FORMAT_NETSCAPE + FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM FORMAT_PKCS12 FORMAT_SMIME FORMAT_ENGINE FORMAT_IISSGC OPENSSL_VERSION_NUMBER ); @@ -161,7 +161,7 @@ None by default. On request: - FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM FORMAT_NETSCAPE + FORMAT_UNDEF FORMAT_ASN1 FORMAT_TEXT FORMAT_PEM FORMAT_PKCS12 FORMAT_SMIME FORMAT_ENGINE FORMAT_IISSGC @@ -249,7 +249,7 @@ Return Boolean value if subject and issuer name are the same. =item as_string ( [ FORMAT ] ) -Return the certificate as a string in the specified format. C can be one of C (the default), C, or C. +Return the certificate as a string in the specified format. C can be one of C (the default) or C. =item modulus ( ) diff --git a/X509.xs b/X509.xs index 8380ff9..a08ed81 100644 --- a/X509.xs +++ b/X509.xs @@ -21,14 +21,11 @@ #define FORMAT_ASN1 1 #define FORMAT_TEXT 2 #define FORMAT_PEM 3 -#define FORMAT_NETSCAPE 4 #define FORMAT_PKCS12 5 #define FORMAT_SMIME 6 #define FORMAT_ENGINE 7 #define FORMAT_IISSGC 8 -#define NETSCAPE_CERT_HDR "certificate" - /* fake our package name */ typedef X509* Crypt__OpenSSL__X509; typedef X509_EXTENSION* Crypt__OpenSSL__X509__Extension; @@ -38,6 +35,9 @@ typedef X509_NAME_ENTRY* Crypt__OpenSSL__X509__Name_Entry; typedef X509_CRL* Crypt__OpenSSL__X509__CRL; /* 1.0 backwards compat */ +#if OPENSSL_VERSION_NUMBER < 0x10100000 +#define const_ossl11 + #ifndef sk_OPENSSL_STRING_num #define sk_OPENSSL_STRING_num sk_num #endif @@ -46,6 +46,76 @@ typedef X509_CRL* Crypt__OpenSSL__X509__CRL; #define sk_OPENSSL_STRING_value sk_value #endif +static ASN1_INTEGER *X509_get0_serialNumber(const X509 *a) +{ + return a->cert_info->serialNumber; +} + +static void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) +{ + if (n != NULL) + *n = r->n; + if (e != NULL) + *e = r->e; + if (d != NULL) + *d = r->d; +} + +static RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) +{ + if (pkey->type != EVP_PKEY_RSA) + return NULL; + return pkey->pkey.rsa; +} + +static void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = crl->signature; + if (palg != NULL) + *palg = crl->sig_alg; +} + +static void DSA_get0_pqg(const DSA *d, + const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) +{ + if (p != NULL) + *p = d->p; + if (q != NULL) + *q = d->q; + if (g != NULL) + *g = d->g; +} + +static void DSA_get0_key(const DSA *d, + const BIGNUM **pub_key, const BIGNUM **priv_key) +{ + if (pub_key != NULL) + *pub_key = d->pub_key; + if (priv_key != NULL) + *priv_key = d->priv_key; +} + +static DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey) +{ + if (pkey->type != EVP_PKEY_DSA) + return NULL; + return pkey->pkey.dsa; +} + +static EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) +{ + if (pkey->type != EVP_PKEY_EC) + return NULL; + return pkey->pkey.ec; +} + +#else +#define const_ossl11 const +#endif + /* Unicode 0xfffd */ static U8 utf8_substitute_char[3] = { 0xef, 0xbf, 0xbd }; @@ -211,35 +281,6 @@ static HV* hv_exts(X509* x509, int no_name) { return RETVAL; } -void _decode_netscape(BIO *bio, X509 *x509) { -#if OPENSSL_VERSION_NUMBER >= 0x10000000L - - NETSCAPE_X509 nx; - ASN1_OCTET_STRING os; - - os.data = (unsigned char *)NETSCAPE_CERT_HDR; - os.length = strlen(NETSCAPE_CERT_HDR); - nx.header = &os; - nx.cert = x509; - - ASN1_item_i2d_bio(ASN1_ITEM_rptr(NETSCAPE_X509), bio, &nx); - -#else - - ASN1_HEADER ah; - ASN1_OCTET_STRING os; - - os.data = (unsigned char *)NETSCAPE_CERT_HDR; - os.length = strlen(NETSCAPE_CERT_HDR); - ah.header = &os; - ah.data = (char *)x509; - ah.meth = X509_asn1_meth(); - - ASN1_i2d_bio((i2d_of_void *)i2d_ASN1_HEADER, bio, (unsigned char *)&ah); - -#endif -} - MODULE = Crypt::OpenSSL::X509 PACKAGE = Crypt::OpenSSL::X509 PROTOTYPES: DISABLE @@ -255,7 +296,6 @@ BOOT: {"FORMAT_ASN1", FORMAT_ASN1}, {"FORMAT_TEXT", FORMAT_TEXT}, {"FORMAT_PEM", FORMAT_PEM}, - {"FORMAT_NETSCAPE", FORMAT_NETSCAPE}, {"FORMAT_PKCS12", FORMAT_PKCS12}, {"FORMAT_SMIME", FORMAT_SMIME}, {"FORMAT_ENGINE", FORMAT_ENGINE}, @@ -354,7 +394,9 @@ __X509_cleanup(void) CRYPTO_cleanup_all_ex_data(); ERR_free_strings(); +#if OPENSSL_VERSION_NUMBER < 0x10100000 ERR_remove_state(0); +#endif EVP_cleanup(); SV* @@ -398,7 +440,7 @@ accessor(x509) } else if (ix == 3) { - i2a_ASN1_INTEGER(bio, x509->cert_info->serialNumber); + i2a_ASN1_INTEGER(bio, X509_get0_serialNumber(x509)); } else if (ix == 4) { @@ -425,14 +467,24 @@ accessor(x509) } else if (ix == 8) { - i2a_ASN1_INTEGER(bio, x509->cert_info->version); + BIO_printf(bio, "%02ld", X509_get_version(x509)); } else if (ix == 9) { + const_ossl11 X509_ALGOR *palg; + const_ossl11 ASN1_OBJECT *paobj; - i2a_ASN1_OBJECT(bio, x509->sig_alg->algorithm); + X509_get0_signature(NULL, &palg, x509); + X509_ALGOR_get0(&paobj, NULL, NULL, palg); + + i2a_ASN1_OBJECT(bio, paobj); } else if ( ix == 10 ) { + X509_PUBKEY *pkey; + ASN1_OBJECT *ppkalg; + + pkey = X509_get_X509_PUBKEY(x509); + X509_PUBKEY_get0_param(&ppkalg, NULL, NULL, NULL, pkey); - i2a_ASN1_OBJECT(bio, x509->cert_info->key->algor->algorithm); + i2a_ASN1_OBJECT(bio, ppkalg); } RETVAL = sv_bio_final(bio); @@ -465,12 +517,14 @@ sig_print(x509) PREINIT: BIO *bio; unsigned char *s; + const_ossl11 ASN1_BIT_STRING *psig; int n,i; CODE: - n = x509->signature->length; - s = x509->signature->data; + X509_get0_signature(&psig, NULL, x509); + n = psig->length; + s = psig->data; bio = sv_bio_create(); for (i=0; itype) { + switch(EVP_PKEY_base_id(pkey)) { case EVP_PKEY_RSA: - length = BN_num_bits(pkey->pkey.rsa->n); + rsa_pkey = EVP_PKEY_get0_RSA(pkey); + RSA_get0_key(rsa_pkey, &n, NULL, NULL); + length = BN_num_bits(n); break; case EVP_PKEY_DSA: - length = BN_num_bits(pkey->pkey.dsa->p); + dsa_pkey = EVP_PKEY_get0_DSA(pkey); + DSA_get0_pqg(dsa_pkey, &p, NULL, NULL); + length = BN_num_bits(p); break; #ifndef OPENSSL_NO_EC case EVP_PKEY_EC: @@ -545,8 +605,8 @@ bit_length(x509) EVP_PKEY_free(pkey); croak("Could not malloc bignum"); } - // - if ( (group = EC_KEY_get0_group(pkey->pkey.ec)) == NULL) { + ec_pkey = EVP_PKEY_get0_EC_KEY(pkey); + if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) { EVP_PKEY_free(pkey); croak("No EC group"); } @@ -590,10 +650,12 @@ curve(x509) EVP_PKEY_free(pkey); croak("Public key is unavailable\n"); } - if ( pkey->type == EVP_PKEY_EC ) { + if ( EVP_PKEY_base_id(pkey) == EVP_PKEY_EC ) { const EC_GROUP *group; + EC_KEY *ec_pkey; int nid; - if ( (group = EC_KEY_get0_group(pkey->pkey.ec)) == NULL) { + ec_pkey = EVP_PKEY_get0_EC_KEY(pkey); + if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) { EVP_PKEY_free(pkey); croak("No EC group"); } @@ -621,6 +683,7 @@ modulus(x509) PREINIT: EVP_PKEY *pkey; BIO *bio; + int pkey_id; CODE: @@ -634,25 +697,38 @@ modulus(x509) croak("Modulus is unavailable\n"); } - if (pkey->type == EVP_PKEY_RSA) { + pkey_id = EVP_PKEY_base_id(pkey); + if (pkey_id == EVP_PKEY_RSA) { + RSA *rsa_pkey; + const BIGNUM *n; - BN_print(bio, pkey->pkey.rsa->n); + rsa_pkey = EVP_PKEY_get0_RSA(pkey); + RSA_get0_key(rsa_pkey, &n, NULL, NULL); - } else if (pkey->type == EVP_PKEY_DSA) { + BN_print(bio, n); - BN_print(bio, pkey->pkey.dsa->pub_key); + } else if (pkey_id == EVP_PKEY_DSA) { + DSA *dsa_pkey; + const BIGNUM *pub_key; + + dsa_pkey = EVP_PKEY_get0_DSA(pkey); + DSA_get0_key(dsa_pkey, &pub_key, NULL); + BN_print(bio, pub_key); #ifndef OPENSSL_NO_EC - } else if ( pkey->type == EVP_PKEY_EC ) { + } else if ( pkey_id == EVP_PKEY_EC ) { const EC_POINT *public_key; const EC_GROUP *group; + EC_KEY *ec_pkey; BIGNUM *pub_key=NULL; - if ( (group = EC_KEY_get0_group(pkey->pkey.ec)) == NULL) { + + ec_pkey = EVP_PKEY_get0_EC_KEY(pkey); + if ( (group = EC_KEY_get0_group(ec_pkey)) == NULL) { BIO_free_all(bio); EVP_PKEY_free(pkey); croak("No EC group"); } - public_key = EC_KEY_get0_public_key(pkey->pkey.ec); - if ((pub_key = EC_POINT_point2bn(group, public_key, EC_KEY_get_conv_form(pkey->pkey.ec), NULL, NULL)) == NULL) { + public_key = EC_KEY_get0_public_key(ec_pkey); + if ((pub_key = EC_POINT_point2bn(group, public_key, EC_KEY_get_conv_form(ec_pkey), NULL, NULL)) == NULL) { BIO_free_all(bio); EVP_PKEY_free(pkey); croak("EC library error"); @@ -697,8 +773,14 @@ exponent(x509) croak("Exponent is unavailable\n"); } - if (pkey->type == EVP_PKEY_RSA) { - BN_print(bio, pkey->pkey.rsa->e); + if (EVP_PKEY_base_id(pkey) == EVP_PKEY_RSA) { + RSA *rsa_pkey; + const BIGNUM *e; + + rsa_pkey = EVP_PKEY_get0_RSA(pkey); + RSA_get0_key(rsa_pkey, NULL, &e, NULL); + + BN_print(bio, e); } else { BIO_free_all(bio); EVP_PKEY_free(pkey); @@ -780,6 +862,7 @@ pubkey(x509) PREINIT: EVP_PKEY *pkey; BIO *bio; + int pkey_id; CODE: @@ -793,16 +876,25 @@ pubkey(x509) croak("Public Key is unavailable\n"); } - if (pkey->type == EVP_PKEY_RSA) { + pkey_id = EVP_PKEY_base_id(pkey); + if (pkey_id == EVP_PKEY_RSA) { + RSA *rsa_pkey; + + rsa_pkey = EVP_PKEY_get0_RSA(pkey); + PEM_write_bio_RSAPublicKey(bio, rsa_pkey); - PEM_write_bio_RSAPublicKey(bio, pkey->pkey.rsa); + } else if (pkey_id == EVP_PKEY_DSA) { + DSA *dsa_pkey; - } else if (pkey->type == EVP_PKEY_DSA) { + dsa_pkey = EVP_PKEY_get0_DSA(pkey); - PEM_write_bio_DSA_PUBKEY(bio, pkey->pkey.dsa); + PEM_write_bio_DSA_PUBKEY(bio, dsa_pkey); #ifndef OPENSSL_NO_EC - } else if ( pkey->type == EVP_PKEY_EC ) { - PEM_write_bio_EC_PUBKEY(bio, pkey->pkey.ec); + } else if (pkey_id == EVP_PKEY_EC ) { + EC_KEY *ec_pkey; + + ec_pkey = EVP_PKEY_get0_EC_KEY(pkey); + PEM_write_bio_EC_PUBKEY(bio, ec_pkey); #endif } else { @@ -823,6 +915,7 @@ pubkey_type(x509) Crypt::OpenSSL::X509 x509; PREINIT: EVP_PKEY *pkey; + int pkey_id; CODE: RETVAL=NULL; pkey = X509_get_pubkey(x509); @@ -830,13 +923,14 @@ pubkey_type(x509) if(!pkey) XSRETURN_UNDEF; - if (pkey->type == EVP_PKEY_DSA) { + pkey_id = EVP_PKEY_base_id(pkey); + if (pkey_id == EVP_PKEY_DSA) { RETVAL="dsa"; - } else if (pkey->type == EVP_PKEY_RSA) { + } else if (pkey_id == EVP_PKEY_RSA) { RETVAL="rsa"; #ifndef OPENSSL_NO_EC - } else if ( pkey->type == EVP_PKEY_EC ) { + } else if (pkey_id == EVP_PKEY_EC ) { RETVAL="ec"; #endif } @@ -1479,7 +1573,13 @@ CRL_accessor(crl) RETVAL = sv_bio_final(bio); } else if (ix == 2) { - i2a_ASN1_OBJECT(bio, crl->sig_alg->algorithm); + const_ossl11 X509_ALGOR *palg; + const_ossl11 ASN1_OBJECT *paobj; + + X509_CRL_get0_signature(crl, NULL, &palg); + X509_ALGOR_get0(&paobj, NULL, NULL, palg); + + i2a_ASN1_OBJECT(bio, paobj); } RETVAL = sv_bio_final(bio); diff --git a/inc/Module/AutoInstall.pm b/inc/Module/AutoInstall.pm index aa7aa92..22dfa82 100644 --- a/inc/Module/AutoInstall.pm +++ b/inc/Module/AutoInstall.pm @@ -8,7 +8,7 @@ use ExtUtils::MakeMaker (); use vars qw{$VERSION}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; } # special map on pre-defined feature sets @@ -115,7 +115,7 @@ sub import { print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); $Config = []; @@ -166,7 +166,7 @@ sub import { $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } - if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability + if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { @@ -345,22 +345,26 @@ sub install { my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); - my ( @modules, @installed ); - while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) { + my ( @modules, @installed, @modules_to_upgrade ); + while (my ($pkg, $ver) = splice(@_, 0, 2)) { - # grep out those already installed - if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { - push @installed, $pkg; - } - else { - push @modules, $pkg, $ver; - } - } + # grep out those already installed + if (_version_cmp(_version_of($pkg), $ver) >= 0) { + push @installed, $pkg; + if ($UpgradeDeps) { + push @modules_to_upgrade, $pkg, $ver; + } + } + else { + push @modules, $pkg, $ver; + } + } - if ($UpgradeDeps) { - push @modules, @installed; - @installed = (); - } + if ($UpgradeDeps) { + push @modules, @modules_to_upgrade; + @installed = (); + @modules_to_upgrade = (); + } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell @@ -533,7 +537,7 @@ sub _install_cpan { while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option - $CPAN::Config->{$opt} = $arg; + $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { @@ -611,7 +615,7 @@ sub _under_cpan { require Cwd; require File::Spec; - my $cwd = File::Spec->canonpath( Cwd::cwd() ); + my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); @@ -927,4 +931,4 @@ END_MAKE __END__ -#line 1193 +#line 1197 diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm index 4ecf46b..f44ab4d 100644 --- a/inc/Module/Install.pm +++ b/inc/Module/Install.pm @@ -17,7 +17,7 @@ package Module::Install; # 3. The ./inc/ version of Module::Install loads # } -use 5.005; +use 5.006; use strict 'vars'; use Cwd (); use File::Find (); @@ -31,7 +31,7 @@ BEGIN { # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.06'; + $VERSION = '1.16'; # Storage for the pseudo-singleton $MAIN = undef; @@ -156,10 +156,10 @@ END_DIE sub autoload { my $self = shift; my $who = $self->_caller; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { - my $pwd = Cwd::cwd(); + my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; @@ -239,7 +239,7 @@ sub new { # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); - unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { + unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; @@ -338,7 +338,7 @@ sub find_extensions { if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; - foreach ( split //, $content ) { + foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text @@ -378,6 +378,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -386,6 +387,7 @@ END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -416,6 +418,7 @@ eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -425,6 +428,7 @@ END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -434,7 +438,7 @@ END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). -sub _version ($) { +sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { @@ -450,12 +454,12 @@ sub _version ($) { return $l + 0; } -sub _cmp ($$) { +sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS -sub _CLASS ($) { +sub _CLASS { ( defined $_[0] and diff --git a/inc/Module/Install/AutoInstall.pm b/inc/Module/Install/AutoInstall.pm index 6efe4fe..e19d259 100644 --- a/inc/Module/Install/AutoInstall.pm +++ b/inc/Module/Install/AutoInstall.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm index 802844a..5762a74 100644 --- a/inc/Module/Install/Base.pm +++ b/inc/Module/Install/Base.pm @@ -4,7 +4,7 @@ package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; } # Suspend handler for "redefined" warnings diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm index 22167b8..d859276 100644 --- a/inc/Module/Install/Can.pm +++ b/inc/Module/Install/Can.pm @@ -8,7 +8,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/Compiler.pm b/inc/Module/Install/Compiler.pm index ada2475..62d14e9 100644 --- a/inc/Module/Install/Compiler.pm +++ b/inc/Module/Install/Compiler.pm @@ -7,7 +7,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/External.pm b/inc/Module/Install/External.pm index 53522d6..88ed718 100644 --- a/inc/Module/Install/External.pm +++ b/inc/Module/Install/External.pm @@ -8,7 +8,7 @@ use Module::Install::Base (); use vars qw{$VERSION $ISCORE @ISA}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm index bee0c4f..41d3517 100644 --- a/inc/Module/Install/Fetch.pm +++ b/inc/Module/Install/Fetch.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm index 8310e4c..2eb1d1f 100644 --- a/inc/Module/Install/Include.pm +++ b/inc/Module/Install/Include.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm index 7052f36..e9918d2 100644 --- a/inc/Module/Install/Makefile.pm +++ b/inc/Module/Install/Makefile.pm @@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -133,7 +133,7 @@ sub makemaker_args { return $args; } -# For mm args that take multiple space-seperated args, +# For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm index 58430f3..9792685 100644 --- a/inc/Module/Install/Metadata.pm +++ b/inc/Module/Install/Metadata.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -347,7 +347,7 @@ sub name_from { ^ \s* package \s* ([\w:]+) - \s* ; + [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); @@ -705,7 +705,7 @@ sub _write_mymeta_data { my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; - # Overwrite the non-configure dependency hashs + # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm index eeaa3fe..218a66b 100644 --- a/inc/Module/Install/Win32.pm +++ b/inc/Module/Install/Win32.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm index 85d8018..530749b 100644 --- a/inc/Module/Install/WriteAll.pm +++ b/inc/Module/Install/WriteAll.pm @@ -6,7 +6,7 @@ use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; }