[openib-general] [PATCH 26/29v2] Add kernel portion of user CM implementation

Tom Duffy tduffy at sun.com
Mon Jul 11 16:30:37 PDT 2005


[ un-cc lkml ]

On Mon, 2005-07-11 at 19:16 -0400, Hal Rosenstock wrote:
> > [ also, in future patch bombs, could you please set the references
> > header so that the message thread properly, thanks ]
> 
> How do I do this ?

Attached is the script I use to sent patchbombs.  Thanks to Greg Kroah
and Roland Dreier.

-tduffy

#!/usr/bin/perl -w

# horrible hack of a script to send off a large number of email messages,
# one after each other, all chained together.  This is useful for large
# numbers of patches.
#
# Use at your own risk!!!!
#
# greg kroah-hartman Jan 8, 2002
# <greg at kroah.com>
#
# modifications by Roland Dreier <roland at topspin.com> June 30, 2004 
# changes by Tom Duffy <tduffy at sun.com> July 15, 2004
# 	- include references header for better threading
#
# Released under the artistic license.
#

#
# modify these options each time you run the script
#
$to = 'openib-general at openib.org';
#$to = 'tomduffy at gmail.com';
#$to = 'tduffy at sun.com';

# If you want to chain the first post, fill this in
$initial_reply_to = '';

# a list of patches to send out
@files = (
	['0-message','Use Linux standard linked lists'],
	['dat1','convert the cr list to linux native'],
	['dat2','convert the lmr list to linux native'],
	['dat3','convert the rmr list to linux native'],
	['dat4','convert the pz list to linux native'],
	['dat5','convert the evd list to linux native'],
	['dat6','convert the psp and rsp lists to linux native'],
	['dat7','convert the srq list to linux native'],
	['dat8','convert the hcas ia list to linux native'],
	['dat9','remove all vestiges of dapls linked list implementation'],
);

# count to start subject line [PATCH][n/N] part from
$initial_count = 0;

# Put your name and address here
$from = 'Tom Duffy <tduffy at sun.com>';

# Don't need to change anything below here...

use Mail::Sendmail;

# we make a "fake" message id by taking the current number
# of seconds since the beginning of Unix time and tacking on
# a random number to the end, in case we are called quicker than
# 1 second since the last time we were called.
sub make_message_id
{
        my $date = `date "+\%s"`;
        chomp($date);
        my $pseudo_rand = int (rand(4200));
        $message_id = "<$date$pseudo_rand\@sun.com>";
        print "new message id = $message_id\n";
}

sub send_message
{
        %mail = (       To      =>      $to,
                        From    =>      $from,
                        Subject =>      $subject,
                        Message =>      $message,
                        'In-Reply-To'   =>      $reply_to,
			'References'	=>	$references,
                        'Message-ID'    =>      $message_id,
                        'X-Mailer'      =>      "Evolution 2.2.2",
			'Content-Transfer-Encoding' => "8bit",
                );

        $mail{smtp} = 'localhost';

        sendmail(%mail) or die $Mail::Sendmail::error;

        print "OK. Log says:\n", $Mail::Sendmail::log;
        print "\n\n"
}


$reply_to = $initial_reply_to;
$references = $reply_to;
make_message_id();
$count = $initial_count;
$tot = $#files + $initial_count;

foreach $t (@files) {
        $F = $$t[0];
        open F or die "can't open file $$t[0]";
        undef $/;
        $message = <F>; # slurp the whole file in
        close F;
        $/ = "\n";
        $subject = "[PATCH $count/$tot] kDAPL: " . $$t[1];
        send_message();

#	sleep 10;

        # set up for the next message
        $reply_to = $message_id;
	$references = $references . " " . $message_id;
        make_message_id();
        ++$count;
}




More information about the general mailing list