threads / discuss / 4358

t9001 fails because Net::SMTP is missing

Subject: t9001 fails because Net::SMTP is missing

## tl;dr

6 messages between May 30, 2006 and May 31, 2006.

replies: 5people: 4as markdown or json

Johannes Schindelin· May 30, 2006, 19:26 UTC · lore
Hi,
is it unexpected that there are setups which come without Net::SMTP?
-- snip --
* expecting success: git format-patch -n HEAD^1
     git send-email -from="Example <nobody@example.com>" 
--to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt
0001-Second.txt
Can't locate Net/SMTP.pm in @INC (@INC contains: 
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
/Library/Perl /Library/Perl /Network/Library/Perl/darwin 
/Network/Library/Perl /Network/Library/Perl .) at 
/Users/gene099/my/git-current/t/../git-send-email line 24.
BEGIN failed--compilation aborted at 
/Users/gene099/my/git-current/t/../git-send-email line 24.
* FAIL 3: Extract patches and send
-- snap --

Ciao, Dscho

Junio C Hamano· May 31, 2006, 00:34 UTC · re: Johannes Schindelin · lore

Re: t9001 fails because Net::SMTP is missing

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 8 quoted lines
> is it unexpected that there are setups which come without Net::SMTP?
>
> -- snip --
> * expecting success: git format-patch -n HEAD^1
>      git send-email -from="Example <nobody@example.com>" 
> --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt
> 0001-Second.txt
> Can't locate Net/SMTP.pm in @INC (@INC contains: 
Hmm.  Something like this?
-- >8 --
diff --git a/git-send-email.perl b/git-send-email.perl
index 0e368ff..f7af8eb 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -21,7 +21,6 @@ use warnings;
 use Term::ReadLine;
 use Getopt::Long;
 use Data::Dumper;
-use Net::SMTP;
 
 # most mail servers generate the Date: header, but not all...
 $ENV{LC_ALL} = 'C';
@@ -394,6 +393,7 @@ X-Mailer: git-send-email $gitversion
 		print $sm "$header\n$message";
 		close $sm or die $?;
 	} else {
+		use Net::SMTP;
 		$smtp ||= Net::SMTP->new( $smtp_server );
 		$smtp->mail( $from ) or die $smtp->message;
 		$smtp->to( @recipients ) or die $smtp->message;
Junio C Hamano· May 31, 2006, 00:37 UTC · re: Junio C Hamano · lore

Re: t9001 fails because Net::SMTP is missing

Junio C Hamano <junkio@cox.net> writes:
Show 12 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
>> is it unexpected that there are setups which come without Net::SMTP?
>>
>> -- snip --
>> * expecting success: git format-patch -n HEAD^1
>>      git send-email -from="Example <nobody@example.com>" 
>> --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt
>> 0001-Second.txt
>> Can't locate Net/SMTP.pm in @INC (@INC contains: 
>
> Hmm.  Something like this?

Nah, nevermind. I forgot my Perl that use has the magic BEGIN{} block around it X-<.

Eric Wong· May 31, 2006, 06:05 UTC · re: Junio C Hamano · lore

Re: t9001 fails because Net::SMTP is missing

Junio C Hamano <junkio@cox.net> wrote:
Show 17 quoted lines
> Junio C Hamano <junkio@cox.net> writes:
> 
> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> >
> >> is it unexpected that there are setups which come without Net::SMTP?
> >>
> >> -- snip --
> >> * expecting success: git format-patch -n HEAD^1
> >>      git send-email -from="Example <nobody@example.com>" 
> >> --to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt
> >> 0001-Second.txt
> >> Can't locate Net/SMTP.pm in @INC (@INC contains: 
> >
> > Hmm.  Something like this?
> 
> Nah, nevermind.  I forgot my Perl that use has the magic BEGIN{}
> block around it X-<.

s/use/require/ and you should be fine. We don't need any thing imported from Net::SMTP, either.

Odd that Net::SMTP isn't installed on Johannes' machine, though, as it's part of the standard Perl 5.8 (maybe even before) installation.

-- 
Eric Wong
Johannes Schindelin· May 31, 2006, 08:32 UTC · re: Eric Wong · lore

Re: t9001 fails because Net::SMTP is missing

Hi,
On Tue, 30 May 2006, Eric Wong wrote:
> Odd that Net::SMTP isn't installed on Johannes' machine, though, as it's
> part of the standard Perl 5.8 (maybe even before) installation.
In terms of corporate setups, 5.8 really is pretty new, you know?

As for "s/use/require/", I can not access on that machine today, but I will test it.

Ciao, Dscho

← back to recent threads