aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/git/Makefile1
-rw-r--r--devel/git/files/patch-git-send-email.perl84
2 files changed, 54 insertions, 31 deletions
diff --git a/devel/git/Makefile b/devel/git/Makefile
index 137aa1ef5020..687563053474 100644
--- a/devel/git/Makefile
+++ b/devel/git/Makefile
@@ -3,6 +3,7 @@
PORTNAME= git
DISTVERSION= 2.13.0
+PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= KERNEL_ORG/software/scm/git
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
diff --git a/devel/git/files/patch-git-send-email.perl b/devel/git/files/patch-git-send-email.perl
index 7a81270bd930..2ccc08be70ea 100644
--- a/devel/git/files/patch-git-send-email.perl
+++ b/devel/git/files/patch-git-send-email.perl
@@ -1,45 +1,51 @@
---- git-send-email.perl.orig 2017-03-21 10:10:31 UTC
+diff --git a/git-send-email.perl b/git-send-email.perl
+index eea0a517f71b6..0d90439d9a8e5 100755
+--- git-send-email.perl
+++ git-send-email.perl
-@@ -27,6 +27,7 @@ use Term::ANSIColor;
- use File::Temp qw/ tempdir tempfile /;
- use File::Spec::Functions qw(catfile);
- use Error qw(:try);
-+use Net::SMTP 2.34;
- use Git;
- use Git::I18N;
-
-@@ -1355,7 +1356,6 @@ EOF
+@@ -1353,10 +1353,12 @@ sub send_message {
+ die __("The required SMTP server is not properly defined.")
+ }
++ require Net::SMTP;
++ my $use_net_smtp_ssl = version->parse($Net::SMTP::VERSION) < version->parse("2.34");
++ $smtp_domain ||= maildomain();
++
if ($smtp_encryption eq 'ssl') {
$smtp_server_port ||= 465; # ssmtp
- require Net::SMTP::SSL;
- $smtp_domain ||= maildomain();
+- $smtp_domain ||= maildomain();
require IO::Socket::SSL;
-@@ -1365,35 +1365,22 @@ EOF
- $IO::Socket::SSL::DEBUG = 1;
- }
-
-- # Net::SMTP::SSL->new() does not forward any SSL options
-- IO::Socket::SSL::set_client_defaults(
-- ssl_verify_params());
+ # Suppress "variable accessed once" warning.
+@@ -1368,34 +1370,48 @@ sub send_message {
+ # Net::SMTP::SSL->new() does not forward any SSL options
+ IO::Socket::SSL::set_client_defaults(
+ ssl_verify_params());
- $smtp ||= Net::SMTP::SSL->new($smtp_server,
- Hello => $smtp_domain,
- Port => $smtp_server_port,
- Debug => $debug_net_smtp);
-+ $smtp = Net::SMTP->new($smtp_server,
-+ Hello => $smtp_domain,
-+ Port => $smtp_server_port,
-+ SSL => 1,
-+ ssl_verify_params(),
-+ Debug => $debug_net_smtp);
++
++ if ($use_net_smtp_ssl) {
++ require Net::SMTP::SSL;
++ $smtp ||= Net::SMTP::SSL->new($smtp_server,
++ Hello => $smtp_domain,
++ Port => $smtp_server_port,
++ Debug => $debug_net_smtp);
++ }
++ else {
++ $smtp ||= Net::SMTP->new($smtp_server,
++ Hello => $smtp_domain,
++ Port => $smtp_server_port,
++ Debug => $debug_net_smtp,
++ SSL => 1);
++ }
}
else {
- require Net::SMTP;
- $smtp_domain ||= maildomain();
$smtp_server_port ||= 25;
-- $smtp ||= Net::SMTP->new($smtp_server,
-+ $smtp = Net::SMTP->new($smtp_server,
+ $smtp ||= Net::SMTP->new($smtp_server,
Hello => $smtp_domain,
Debug => $debug_net_smtp,
Port => $smtp_server_port);
@@ -48,16 +54,32 @@
- $smtp->command('STARTTLS');
- $smtp->response();
- if ($smtp->code == 220) {
-- $smtp = Net::SMTP::SSL->start_SSL($smtp,
-- ssl_verify_params())
++ if ($use_net_smtp_ssl) {
++ $smtp->command('STARTTLS');
++ $smtp->response();
++ if ($smtp->code != 220) {
++ die sprintf(__("Server does not support STARTTLS! %s"), $smtp->message);
++ }
++ require Net::SMTP::SSL;
+ $smtp = Net::SMTP::SSL->start_SSL($smtp,
+ ssl_verify_params())
- or die "STARTTLS failed! ".IO::Socket::SSL::errstr();
- $smtp_encryption = '';
- # Send EHLO again to receive fresh
- # supported commands
- $smtp->hello($smtp_domain);
- } else {
-+ $smtp->starttls(ssl_verify_params());
-+ if ($smtp->code != 250) {
- die sprintf(__("Server does not support STARTTLS! %s"), $smtp->message);
+- die sprintf(__("Server does not support STARTTLS! %s"), $smtp->message);
++ or die sprintf(__("STARTTLS failed! %s"), IO::Socket::SSL::errstr());
++ }
++ else {
++ $smtp->starttls(ssl_verify_params())
++ or die sprintf(__("STARTTLS failed! %s"), IO::Socket::SSL::errstr());
}
++ $smtp_encryption = '';
++ # Send EHLO again to receive fresh
++ # supported commands
++ $smtp->hello($smtp_domain);
}
+ }
+