summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--META.yml9
-rw-r--r--Makefile.PL16
-rw-r--r--SIGNATURE32
-rw-r--r--inc/Module/Install.pm6
-rw-r--r--inc/Module/Install/Base.pm2
-rw-r--r--inc/Module/Install/Can.pm85
-rw-r--r--inc/Module/Install/Fetch.pm2
-rw-r--r--inc/Module/Install/Makefile.pm27
-rw-r--r--inc/Module/Install/Metadata.pm22
-rw-r--r--inc/Module/Install/Win32.pm2
-rw-r--r--inc/Module/Install/WriteAll.pm2
-rw-r--r--lib/GnuPG/Interface.pm35
-rw-r--r--t/MyTestSpecific.pm14
14 files changed, 182 insertions, 78 deletions
diff --git a/ChangeLog b/ChangeLog
index f27c9eb..8c46d6e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+0.46 Thu Oct 25 14:04:17 EDT 2012
+
+ Add a ->search_keys method
+ Add a ->version method
+ Remove dead code for finding gnupg2 binary
+
0.45 Wed Oct 26 00:11:17 EDT 2011
Include trailing columns when parsing --fixed-list-mode output
diff --git a/META.yml b/META.yml
index d46cde6..1beaef2 100644
--- a/META.yml
+++ b/META.yml
@@ -3,11 +3,12 @@ abstract: 'supply object methods for interacting with GnuPG'
author:
- 'Frank J. Tobin'
build_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.36
configure_requires:
- ExtUtils::MakeMaker: 6.42
+ ExtUtils::MakeMaker: 6.36
distribution_type: module
-generated_by: 'Module::Install version 1.01'
+dynamic_config: 1
+generated_by: 'Module::Install version 1.06'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,4 +24,4 @@ requires:
Math::BigInt: 1.78
resources:
license: http://dev.perl.org/licenses/
-version: 0.45
+version: 0.46
diff --git a/Makefile.PL b/Makefile.PL
index 58c3e78..8156e7f 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,14 +2,14 @@ use strict;
use warnings;
use inc::Module::Install;
-for my $gpg qw(gpg gpg2) {
- my $gpg_find = "which $gpg";
- print "$gpg_find ... ";
- system($gpg_find);
- if ( $? != 0 ) {
- die "gpg (GnuPG) not found";
- } else { last }
-}
+print "which gpg ... ";
+system("which", "gpg");
+die "gpg (GnuPG) not found" if ( $? != 0 );
+
+my $output = `gpg --version`;
+die "Can't determine gpg version"
+ unless $output =~ /^gpg \(GnuPG\) (\d+\.\d+)/;
+die "gpg (GnuPG) 1.4 or later is required" unless $1 >= 1.4;
author 'Frank J. Tobin';
diff --git a/SIGNATURE b/SIGNATURE
index 9152e04..5074a6b 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -15,26 +15,26 @@ not run its Makefile.PL or Build.PL.
Hash: SHA1
SHA1 187c2cfc1fc31d42c18d5b1653afa1a905bf266c COPYING
-SHA1 5c764f307f85459e299f91631bfd1ca457914980 ChangeLog
+SHA1 b9db27c778702df04650d3cdb6f791fca8cc727c ChangeLog
SHA1 37e4d07c43f08f41a24fd1157ab530a4a06aab37 MANIFEST
SHA1 0c5f7bda8a3ce57e27dcd7f32459d8b286f1339e MANIFEST.SKIP
-SHA1 66dae95badc5d95fa5f16a2e4c85b48d9615192e META.yml
-SHA1 6b0ad3ccd9e2ed8aa1489e2951aec36236e11ff5 Makefile.PL
+SHA1 863944080648e823e852f3b58c768897a709de59 META.yml
+SHA1 7782ec3ebf4194b81b83f39f0c0f5564e0363149 Makefile.PL
SHA1 d6e32c5128419cdbfe6e6f846ff7f64fc0adac2f NEWS
SHA1 1047dc54823b1321e939274dd261d8e40febee24 README
SHA1 df07bf5a2dd74ffe4b69dff3063f68879cf9e355 THANKS
-SHA1 7b4ae50ebac72d20761171c4c2b50c206344ea40 inc/Module/Install.pm
-SHA1 d9fe55a427fe2fd75b5029afeeaa61b592e07f79 inc/Module/Install/Base.pm
-SHA1 62d3922826d9f89f20c185e7031ac8f028504745 inc/Module/Install/Can.pm
-SHA1 dc809f64fb70a26b069a36f8d3d353d520dbb7e1 inc/Module/Install/Fetch.pm
-SHA1 73ab91490a628452cc140db72ef9d13a1326d211 inc/Module/Install/Makefile.pm
-SHA1 8ce3f2b414e4617e6233dd4ba10830f8c5d672ec inc/Module/Install/Metadata.pm
-SHA1 3b0acd2eeac93a0afe48120f5648f0db362e5bbf inc/Module/Install/Win32.pm
-SHA1 f08924f051e623f8e09fa6a121993c4a9cf7d9eb inc/Module/Install/WriteAll.pm
+SHA1 8a924add836b60fb23b25c8506d45945e02f42f4 inc/Module/Install.pm
+SHA1 2d0fad3bf255f8c1e7e1e34eafccc4f595603ddc inc/Module/Install/Base.pm
+SHA1 f0e01fff7d73cd145fbf22331579918d4628ddb0 inc/Module/Install/Can.pm
+SHA1 7328966e4fda0c8451a6d3850704da0b84ac1540 inc/Module/Install/Fetch.pm
+SHA1 b62ca5e2d58fa66766ccf4d64574f9e1a2250b34 inc/Module/Install/Makefile.pm
+SHA1 1aa925be410bb3bfcd84a16985921f66073cc1d2 inc/Module/Install/Metadata.pm
+SHA1 e4196994fa75e98bdfa2be0bdeeffef66de88171 inc/Module/Install/Win32.pm
+SHA1 c3a6d0d5b84feb3280622e9599e86247d58b0d18 inc/Module/Install/WriteAll.pm
SHA1 9a2b6c9e5434daf32bc2a3e15e25175fc49fd604 lib/GnuPG/Fingerprint.pm
SHA1 8852195e80823c93b6aed673e69433ae3ea46d26 lib/GnuPG/Handles.pm
SHA1 779e6a921fa104e8f16fd4a6d38f670074592811 lib/GnuPG/HashInit.pm
-SHA1 ab0e8768af5fdcf6dd0afcec812ddbdbe6baa965 lib/GnuPG/Interface.pm
+SHA1 d959f3b7feeacc017836b1652dfdc35fa75cce04 lib/GnuPG/Interface.pm
SHA1 bb75d45acb8268096348740e261812519b7258cb lib/GnuPG/Key.pm
SHA1 697b1408b404e4dff0ae553646fb3c12f821fcd4 lib/GnuPG/Options.pm
SHA1 5fbf442fc1586b88139508b838700b7a3992ced7 lib/GnuPG/PrimaryKey.pm
@@ -48,7 +48,7 @@ SHA1 145730a6ccc5d543a65ee25411bb6d8119dc8fce lib/GnuPG/UserId.pm
SHA1 367fdb308292a9c005afffef49ff9096a20a4da3 t/Fingerprint.t
SHA1 8791d014e4efd4cf11998386e1651cc4eb16dd26 t/Interface.t
SHA1 698ec633be083b7e762331f1a5106c1618c74dd3 t/MyTest.pm
-SHA1 52114a082f32bdbf284eb968afe458866854996e t/MyTestSpecific.pm
+SHA1 a3aef62cb9ec31d2d398548114685ba8c5cdeb93 t/MyTestSpecific.pm
SHA1 ccd942d9f00627253d7eb9c011116dc5671639b8 t/UserId.t
SHA1 16ac3a802f059cad9b7a0567eebe8b9599cc2551 t/clearsign.t
SHA1 fab3deb7f60a0b5aae2f92b1c39804d1a4df2848 t/decrypt.t
@@ -95,7 +95,7 @@ SHA1 da39a3ee5e6b4b0d3255bfef95601890afd80709 test/temp
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
-iEYEARECAAYFAk6niVQACgkQMflWJZZAbqAV9wCfYI50uHPwn42mYOoQoK6KMkN2
-ul0AoLVqEZGkGEH6bD/ieLhPzza9u+Pd
-=FYf9
+iEYEARECAAYFAlCJua0ACgkQMflWJZZAbqAi2gCeILIoMJtmSIWZy84mCc/R3QLu
+GhcAn3kzvFOY1WcfRT6ayUD9GoJvQ5kz
+=6FyK
-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 74caf9c..4ecf46b 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -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.01';
+ $VERSION = '1.06';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -451,7 +451,7 @@ sub _version ($) {
}
sub _cmp ($$) {
- _version($_[0]) <=> _version($_[1]);
+ _version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
@@ -467,4 +467,4 @@ sub _CLASS ($) {
1;
-# Copyright 2008 - 2011 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index d3662c9..802844a 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.01';
+ $VERSION = '1.06';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 276409a..22167b8 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -3,13 +3,12 @@ package Module::Install::Can;
use strict;
use Config ();
-use File::Spec ();
use ExtUtils::MakeMaker ();
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -29,7 +28,7 @@ sub can_use {
eval { require $mod; $pkg->VERSION($ver || 0); 1 };
}
-# check if we can run some command
+# Check if we can run some command
sub can_run {
my ($self, $cmd) = @_;
@@ -38,14 +37,88 @@ sub can_run {
for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
next if $dir eq '';
- my $abs = File::Spec->catfile($dir, $_[1]);
+ require File::Spec;
+ my $abs = File::Spec->catfile($dir, $cmd);
return $abs if (-x $abs or $abs = MM->maybe_command($abs));
}
return;
}
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+ my $self = shift;
+
+ # Ensure we have the CBuilder module
+ $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+ # Do we have the configure_requires checker?
+ local $@;
+ eval "require ExtUtils::CBuilder;";
+ if ( $@ ) {
+ # They don't obey configure_requires, so it is
+ # someone old and delicate. Try to avoid hurting
+ # them by falling back to an older simpler test.
+ return $self->can_cc();
+ }
+
+ # Do we have a working C compiler
+ my $builder = ExtUtils::CBuilder->new(
+ quiet => 1,
+ );
+ unless ( $builder->have_compiler ) {
+ # No working C compiler
+ return 0;
+ }
+
+ # Write a C file representative of what XS becomes
+ require File::Temp;
+ my ( $FH, $tmpfile ) = File::Temp::tempfile(
+ "compilexs-XXXXX",
+ SUFFIX => '.c',
+ );
+ binmode $FH;
+ print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+ return 0;
+}
+
+int boot_sanexs() {
+ return 1;
+}
+
+END_C
+ close $FH;
+
+ # Can the C compiler access the same headers XS does
+ my @libs = ();
+ my $object = undef;
+ eval {
+ local $^W = 0;
+ $object = $builder->compile(
+ source => $tmpfile,
+ );
+ @libs = $builder->link(
+ objects => $object,
+ module_name => 'sanexs',
+ );
+ };
+ my $result = $@ ? 0 : 1;
+
+ # Clean up all the build files
+ foreach ( $tmpfile, $object, @libs ) {
+ next unless defined $_;
+ 1 while unlink;
+ }
+
+ return $result;
+}
+
+# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@ if ( $^O eq 'cygwin' ) {
__END__
-#line 156
+#line 236
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 093cb7a..bee0c4f 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.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 4c71003..7052f36 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.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -215,18 +215,22 @@ sub write {
require ExtUtils::MakeMaker;
if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
- # MakeMaker can complain about module versions that include
- # an underscore, even though its own version may contain one!
- # Hence the funny regexp to get rid of it. See RT #35800
- # for details.
- my $v = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
- $self->build_requires( 'ExtUtils::MakeMaker' => $v );
- $self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+ # This previous attempted to inherit the version of
+ # ExtUtils::MakeMaker in use by the module author, but this
+ # was found to be untenable as some authors build releases
+ # using future dev versions of EU:MM that nobody else has.
+ # Instead, #toolchain suggests we use 6.59 which is the most
+ # stable version on CPAN at time of writing and is, to quote
+ # ribasushi, "not terminally fucked, > and tested enough".
+ # TODO: We will now need to maintain this over time to push
+ # the version up as new versions are released.
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
} else {
# Allow legacy-compatibility with 5.005 by depending on the
# most recent EU:MM that supported 5.005.
- $self->build_requires( 'ExtUtils::MakeMaker' => 6.42 );
- $self->configure_requires( 'ExtUtils::MakeMaker' => 6.42 );
+ $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 );
+ $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 );
}
# Generate the MakeMaker params
@@ -241,7 +245,6 @@ in a module, and provide its file path via 'version_from' (or
'all_from' if you prefer) in Makefile.PL.
EOT
- $DB::single = 1;
if ( $self->tests ) {
my @tests = split ' ', $self->tests;
my %seen;
@@ -412,4 +415,4 @@ sub postamble {
__END__
-#line 541
+#line 544
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 3b01e09..58430f3 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.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -151,15 +151,21 @@ sub install_as_site { $_[0]->installdirs('site') }
sub install_as_vendor { $_[0]->installdirs('vendor') }
sub dynamic_config {
- my $self = shift;
- unless ( @_ ) {
- warn "You MUST provide an explicit true/false value to dynamic_config\n";
- return $self;
+ my $self = shift;
+ my $value = @_ ? shift : 1;
+ if ( $self->{values}->{dynamic_config} ) {
+ # Once dynamic we never change to static, for safety
+ return 0;
}
- $self->{values}->{dynamic_config} = $_[0] ? 1 : 0;
+ $self->{values}->{dynamic_config} = $value ? 1 : 0;
return 1;
}
+# Convenience command
+sub static_config {
+ shift->dynamic_config(0);
+}
+
sub perl_version {
my $self = shift;
return $self->{values}->{perl_version} unless @_;
@@ -170,7 +176,7 @@ sub perl_version {
# Normalize the version
$version = $self->_perl_version($version);
- # We don't support the reall old versions
+ # We don't support the really old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
@@ -582,7 +588,7 @@ sub bugtracker_from {
sub requires_from {
my $self = shift;
my $content = Module::Install::_readperl($_[0]);
- my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg;
+ my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg;
while ( @requires ) {
my $module = shift @requires;
my $version = shift @requires;
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 3139a63..eeaa3fe 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.01';
+ $VERSION = '1.06';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 1f724a7..85d8018 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.01';
+ $VERSION = '1.06';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
index f39fd8b..5d80eeb 100644
--- a/lib/GnuPG/Interface.pm
+++ b/lib/GnuPG/Interface.pm
@@ -27,7 +27,7 @@ use Math::BigInt try => 'GMP';
use GnuPG::Options;
use GnuPG::Handles;
-$VERSION = '0.45';
+$VERSION = '0.46';
has $_ => (
isa => 'Any',
@@ -120,6 +120,8 @@ sub fork_attach_exec( $% ) {
= ref $args{command_args}
? @{ $args{command_args} }
: ( $args{command_args} || () );
+ unshift @command_args, "--"
+ if @command_args and $command_args[0] ne "--";
my %fhs;
foreach my $fh_name (
@@ -745,6 +747,25 @@ sub send_keys( $% ) {
);
}
+sub search_keys( $% ) {
+ my ( $self, %args ) = @_;
+ return $self->wrap_call(
+ %args,
+ commands => ['--search-keys']
+ );
+}
+
+sub version {
+ my ( $self ) = @_;
+
+ my $out = IO::Handle->new;
+ my $handles = GnuPG::Handles->new( stdout => $out );
+ $self->wrap_call( commands => [ '--version' ], handles => $handles );
+ my $line = $out->getline;
+ $line =~ /(\d+\.\d+\.\d+)/;
+ return $1;
+}
+
sub test_default_key_passphrase() {
my ($self) = @_;
@@ -928,6 +949,8 @@ initialization of data members.
=item send_keys( % )
+=item search_keys( % )
+
These methods each correspond directly to or are very similar
to a GnuPG command described in L<gpg>. Each of these methods
takes a hash, which currently must contain a key of B<handles>
@@ -1009,6 +1032,10 @@ while signing a short message using the values of
the B<passphrase> data member, and the default
key specified in the B<options> data member.
+=item version()
+
+Returns the version of GnuPG that GnuPG::Interface is running.
+
=back
@@ -1202,9 +1229,9 @@ The following setup can be done before any of the following examples:
close $input;
close $cipher_file;
- my @plaintext = <$output>; # reading the output
- my @error_output = <$error>; # reading the error
- my @status_info = <$status_fh> # read the status info
+ my @plaintext = <$output>; # reading the output
+ my @error_output = <$error>; # reading the error
+ my @status_info = <$status_fh>; # read the status info
# clean up...
close $output;
diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
index 629c673..7894ccc 100644
--- a/t/MyTestSpecific.pm
+++ b/t/MyTestSpecific.pm
@@ -38,19 +38,7 @@ use vars qw( @ISA @EXPORT
texts file_match
);
-
-for my $gpg qw(gpg gpg2) {
- my $gpg_find = "which $gpg";
- print "$gpg_find ... ";
- system($gpg_find);
- if ( $? != 0 ) {
- die "gpg (GnuPG) not found";
- } else { $gpg_program = $gpg; last }
-}
-
-$gnupg = GnuPG::Interface->new( gnupg_call => $gpg_program,
- passphrase => 'test',
- );
+$gnupg = GnuPG::Interface->new( passphrase => 'test' );
$gnupg->options->hash_init( homedir => 'test',
armor => 1,