From: Jarkko Hietaniemi Date: Tue, 29 Jul 2003 15:27:46 +0000 (+0000) Subject: Don't nag about Module::Signature if there is no X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b64e2de96f86540b6a77752a8a80ad714f1f7b6;p=p5sagit%2Fp5-mst-13.2.git Don't nag about Module::Signature if there is no way for the user to use it (based on Autrijus' patch). p4raw-id: //depot/perl@20316 --- diff --git a/lib/CPAN.pm b/lib/CPAN.pm index 0afcef5..28665a8 100644 --- a/lib/CPAN.pm +++ b/lib/CPAN.pm @@ -1,6 +1,6 @@ # -*- Mode: cperl; coding: utf-8; cperl-indent-level: 4 -*- package CPAN; -$VERSION = '1.74'; +$VERSION = '1.74_01'; # $Id: CPAN.pm,v 1.409 2003/07/28 22:07:23 k Exp $ # only used during development: @@ -774,12 +774,15 @@ sub has_inst { }); sleep 2; } elsif ($mod eq "Module::Signature"){ - $CPAN::Frontend->myprint(qq{ + # No point in complaining unless the user can reasonably install it. + if (eval { require Crypt::OpenPGP; 1 } or + defined $CPAN::Config->{'gpg'}) { + $CPAN::Frontend->myprint(qq{ CPAN: Module::Signature security checks disabled because Module::Signature not installed. Please consider installing the Module::Signature module. - }); - sleep 2; + sleep 2; + } } else { delete $INC{$file}; # if it inc'd LWP but failed during, say, URI } @@ -3667,12 +3670,13 @@ sub dir_listing { File::Spec->catfile($CPAN::Config->{keep_source_where}, "authors", "id", @$chksumfile); - my $fh; - # purge and refetch old (pre-PGP) CHECKSUMS; they are a security hazard + # Purge and refetch old (pre-PGP) CHECKSUMS; they are a security + # hazard. (Without GPG installed they are not that much better, + # though.) $fh = FileHandle->new; - if (open($fh, $lc_want)){ + if (open($fh, $lc_want)) { my $line = <$fh>; close $fh; unlink($lc_want) unless $line =~ /PGP/; } diff --git a/lib/CPAN/FirstTime.pm b/lib/CPAN/FirstTime.pm index 8f9d8f5..30a6c45 100644 --- a/lib/CPAN/FirstTime.pm +++ b/lib/CPAN/FirstTime.pm @@ -292,7 +292,7 @@ by ENTER. my(@path) = split /$Config{'path_sep'}/, $ENV{'PATH'}; local $^W = $old_warn; my $progname; - for $progname (qw/gzip tar unzip make lynx wget ncftpget ncftp ftp/){ + for $progname (qw/gzip tar unzip make lynx wget ncftpget ncftp ftp gpg/){ if ($^O eq 'MacOS') { $CPAN::Config->{$progname} = 'not_here'; next;