summaryrefslogtreecommitdiff
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-15 22:00:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-15 22:00:46 (GMT)
commitae1644b08e85fb64367b273337d8ebcbdabe0685 (patch)
treea4abf768e05299a5152bcbb93b298462b44ad2e7 /git-send-email.perl
parente74737b6a1d403bd0ad856bd23143ba0bd5dfabb (diff)
parent1aca69c0195bd4ac671e7a36cf9b967d2bcbe200 (diff)
downloadgit-ae1644b08e85fb64367b273337d8ebcbdabe0685.zip
git-ae1644b08e85fb64367b273337d8ebcbdabe0685.tar.gz
git-ae1644b08e85fb64367b273337d8ebcbdabe0685.tar.bz2
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-xgit-send-email.perl28
1 files changed, 13 insertions, 15 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 3a68aae..2fa7818 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;
}
}