diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-16 01:00:46 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-16 01:00:46 +0300 |
commit | ae1644b08e85fb64367b273337d8ebcbdabe0685 (patch) | |
tree | a4abf768e05299a5152bcbb93b298462b44ad2e7 /git-send-email.perl | |
parent | e74737b6a1d403bd0ad856bd23143ba0bd5dfabb (diff) | |
parent | 1aca69c0195bd4ac671e7a36cf9b967d2bcbe200 (diff) |
Merge branch 'ab/perl-fixes'
Clean-up to various pieces of Perl code we have.
* ab/perl-fixes:
perl Git::LoadCPAN: emit better errors under NO_PERL_CPAN_FALLBACKS
Makefile: add NO_PERL_CPAN_FALLBACKS knob
perl: move the perl/Git/FromCPAN tree to perl/FromCPAN
perl: generalize the Git::LoadCPAN facility
perl: move CPAN loader wrappers to another namespace
perl: update our copy of Mail::Address
perl: update our ancient copy of Error.pm
git-send-email: unconditionally use Net::{SMTP,Domain}
Git.pm: hard-depend on the File::{Temp,Spec} modules
gitweb: hard-depend on the Digest::MD5 5.8 module
Git.pm: add the "use warnings" pragma
Git.pm: remove redundant "use strict" from sub-package
perl: *.pm files should not have the executable bit
Diffstat (limited to 'git-send-email.perl')
-rwxr-xr-x | git-send-email.perl | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/git-send-email.perl b/git-send-email.perl index 3a68aae060..2fa7818ca9 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -26,11 +26,13 @@ use Text::ParseWords; use Term::ANSIColor; use File::Temp qw/ tempdir tempfile /; use File::Spec::Functions qw(catdir catfile); -use Git::Error qw(:try); +use Git::LoadCPAN::Error qw(:try); use Cwd qw(abs_path cwd); use Git; use Git::I18N; -use Git::Mail::Address; +use Net::Domain (); +use Net::SMTP (); +use Git::LoadCPAN::Mail::Address; Getopt::Long::Configure qw/ pass_through /; @@ -1199,10 +1201,8 @@ sub valid_fqdn { sub maildomain_net { my $maildomain; - if (eval { require Net::Domain; 1 }) { - my $domain = Net::Domain::domainname(); - $maildomain = $domain if valid_fqdn($domain); - } + my $domain = Net::Domain::domainname(); + $maildomain = $domain if valid_fqdn($domain); return $maildomain; } @@ -1210,17 +1210,15 @@ sub maildomain_net { sub maildomain_mta { my $maildomain; - if (eval { require Net::SMTP; 1 }) { - for my $host (qw(mailhost localhost)) { - my $smtp = Net::SMTP->new($host); - if (defined $smtp) { - my $domain = $smtp->domain; - $smtp->quit; + for my $host (qw(mailhost localhost)) { + my $smtp = Net::SMTP->new($host); + if (defined $smtp) { + my $domain = $smtp->domain; + $smtp->quit; - $maildomain = $domain if valid_fqdn($domain); + $maildomain = $domain if valid_fqdn($domain); - last if $maildomain; - } + last if $maildomain; } } |