[Codestriker-commits] CVS update: codestriker/lib/Codestriker/TopicListeners Email.pm
Brought to you by:
sits
|
From: <si...@us...> - 2006-06-10 03:01:42
|
User: sits
Date: 06/06/09 19:58:34
Modified: . CHANGELOG codestriker.conf
bin install.pl
doc codestriker.sgml
lib Codestriker.pm
lib/Codestriker/FileParser Parser.pm
lib/Codestriker/Repository ClearCaseSnapshot.pm Cvs.pm
lib/Codestriker/TopicListeners Email.pm
Log:
* Support for sending email via SMTP authentication, via the optional
$mailuser and $mailpasswd configuration parameters in
codestriker.conf. Contributed by "Hertz Wang" <wa...@ne...>.
* The ClearCase Snapshot repository was not using the $tmpdir setting
in codestriker.conf if it was set when creating temporary files.
This has now been fixed.
Contributed by "John Farrelly (AT/LMI)" <joh...@er...>.
* Make sure the diffs in the topic are presented in a sorted order by
filename. Some SCMs create topic texts in a "semi-sorted" order,
such as Subversion.
Contributed by "Vladimir Vysotsky" <vvy...@av...>.
Index: CHANGELOG
===================================================================
RCS file: /cvsroot/codestriker/codestriker/CHANGELOG,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -r1.189 -r1.190
--- CHANGELOG 9 Jun 2006 03:20:03 -0000 1.189
+++ CHANGELOG 10 Jun 2006 02:58:32 -0000 1.190
@@ -69,6 +69,20 @@
* Defining new entries in $comment_state_metrics in codestriker.conf
could not be used for existing topics. This has now been fixed.
+* Support for sending email via SMTP authentication, via the optional
+ $mailuser and $mailpasswd configuration parameters in
+ codestriker.conf. Contributed by "Hertz Wang" <wa...@ne...>.
+
+* The ClearCase Snapshot repository was not using the $tmpdir setting
+ in codestriker.conf if it was set when creating temporary files.
+ This has now been fixed.
+ Contributed by "John Farrelly (AT/LMI)" <joh...@er...>.
+
+* Make sure the diffs in the topic are presented in a sorted order by
+ filename. Some SCMs create topic texts in a "semi-sorted" order,
+ such as Subversion.
+ Contributed by "Vladimir Vysotsky" <vvy...@av...>.
+
Version 1.9.1
* Correct problem introduced in 1.9.0 release where the email address
Index: codestriker.conf
===================================================================
RCS file: /cvsroot/codestriker/codestriker/codestriker.conf,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- codestriker.conf 30 May 2006 07:18:09 -0000 1.81
+++ codestriker.conf 10 Jun 2006 02:58:32 -0000 1.82
@@ -35,6 +35,12 @@
# comments.
$mailhost = 'localhost';
+# Set the user and password parameters if $mailhost requires SMTP
+# authentication. If commented out, it is assumed authentication is
+# not required.
+#$mailuser = 'smtpuser';
+#$mailpasswd = 'smtppasswd';
+
# Indicate whether to try and compress output if the client browser
# supports it. This can make a tremendous difference in bandwidth,
# especially over slow links.
Index: install.pl
===================================================================
RCS file: /cvsroot/codestriker/codestriker/bin/install.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- install.pl 30 May 2006 07:18:09 -0000 1.6
+++ install.pl 10 Jun 2006 02:58:33 -0000 1.7
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/local/bin/perl -w
###############################################################################
# Codestriker: Copyright (c) 2001, 2002 David Sitsky. All rights reserved.
@@ -109,6 +109,11 @@
name => 'Encode::Unicode',
version => '0',
optional => 0
+ },
+ {
+ name => 'Authen::SASL',
+ version => '0',
+ optional => 0
}
];
Index: codestriker.sgml
===================================================================
RCS file: /cvsroot/codestriker/codestriker/doc/codestriker.sgml,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- codestriker.sgml 31 May 2006 07:02:19 -0000 1.53
+++ codestriker.sgml 10 Jun 2006 02:58:33 -0000 1.54
@@ -393,6 +393,20 @@
# comments.
$mailhost = 'localhost';
</programlisting>
+ If your mail server requires SMTP authentication for
+ sending emails, the username and password can be set via
+ the
+ <varname>$mailuser</varname> and
+ <varname>$mailpasswd</varname> parameters.
+ <programlisting>
+# Set the user and password parameters if $mailhost requires SMTP
+# authentication. If commented out, it is assumed authentication is
+# not required.
+$mailuser = 'smtpuser';
+$mailpasswd = 'smtppasswd';
+ </programlisting>
+ If these values are commented out, it is assumed SMTP
+ authentication is not required.
</para>
</sect2>
Index: Codestriker.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker.pm,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- Codestriker.pm 7 Jun 2006 00:35:01 -0000 1.90
+++ Codestriker.pm 10 Jun 2006 02:58:33 -0000 1.91
@@ -15,7 +15,8 @@
use Time::Local;
# Export codestriker.conf configuration variables.
-use vars qw ( $mailhost $use_compression $gzip $cvs $svn $ssh $p4 $vss $bugtracker
+use vars qw ( $mailhost $mailuser $mailpasswd $use_compression
+ $gzip $cvs $svn $ssh $p4 $vss $bugtracker
@valid_repositories $default_topic_create_mode $default_tabwidth
$file_reviewer $db $dbuser $dbpasswd $codestriker_css
$NORMAL_MODE $COLOURED_MODE $COLOURED_MONO_MODE $topic_states
@@ -24,7 +25,8 @@
$allow_delete $allow_searchlist $default_file_to_view
$allow_projects $antispam_email $VERSION $title $BASEDIR
$metric_config $tmpdir @metric_schema $comment_state_metrics
- $project_states $rss_enabled $repository_name_map $repository_url_map
+ $project_states $rss_enabled
+ $repository_name_map $repository_url_map
@valid_repository_names $topic_text_encoding
);
Index: Parser.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/FileParser/Parser.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- Parser.pm 7 Jun 2006 00:35:02 -0000 1.22
+++ Parser.pm 10 Jun 2006 02:58:34 -0000 1.23
@@ -166,6 +166,10 @@
seek($fh, 0, 0) ||
die "Unable to seek to the start of the temporary file. $!";
+ # Sort the diff chunks by filename, then old linenumber.
+ @diffs = sort { $a->{filename} cmp $b->{filename} ||
+ $a->{old_linenumber} <=> $b->{old_linenumber} } @diffs;
+
# Only include those files whose extension is not in
# @Codestriker::exclude_file_types, provided it is defined.
return @diffs unless defined @Codestriker::exclude_file_types;
Index: ClearCaseSnapshot.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/ClearCaseSnapshot.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClearCaseSnapshot.pm 7 Jun 2006 00:35:02 -0000 1.4
+++ ClearCaseSnapshot.pm 10 Jun 2006 02:58:34 -0000 1.5
@@ -38,7 +38,14 @@
}
# Create a temporary directory to store the results of 'cleartool get'.
- my $tempdir = tempdir();
+ my $tempdir;
+ if (defined $Codestriker::tmpdir && $Codestriker::tmpdir ne "") {
+ $tempdir = tempdir(DIR => $Codestriker::tmpdir, CLEANUP => 1);
+ }
+ else {
+ $tempdir = tempdir(CLEANUP => 1);
+ }
+
my $tempfile = File::Spec->catfile($tempdir, "Temp_YouCanDeleteThis");
my $errorfile = File::Spec->catfile($tempdir, "Error_YouCanDeleteThis");
Index: Cvs.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/Repository/Cvs.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Cvs.pm 7 Jun 2006 00:35:02 -0000 1.4
+++ Cvs.pm 10 Jun 2006 02:58:34 -0000 1.5
@@ -19,8 +19,8 @@
my $self = {};
$self->{cvsroot} = $cvsroot;
- $self->{optional_prefix} =
- defined $optional_prefix ? $optional_prefix : "";
+ $optional_prefix = "" unless defined $optional_prefix;
+ $self->{optional_prefix} = $optional_prefix;
$self->{url} = "${optional_prefix}${cvsroot}";
bless $self, $type;
}
@@ -30,7 +30,8 @@
my ($type, $optional_args, $username, $password, $hostname, $cvsroot) = @_;
my $self = {};
- $self->{optional_args} = defined $optional_args ? $optional_args : "";
+ $optional_args = "" unless defined $optional_args;
+ $self->{optional_args} = $optional_args;
$self->{username} = $username;
$self->{password} = $password;
$self->{hostname} = $hostname;
@@ -45,7 +46,8 @@
my ($type, $optional_args, $username, $hostname, $cvsroot) = @_;
my $self = {};
- $self->{optional_args} = defined $optional_args ? $optional_args : "";
+ $optional_args = "" unless defined $optional_args;
+ $self->{optional_args} = $optional_args;
$self->{username} = $username;
$self->{hostname} = $hostname;
$self->{cvsroot} = $cvsroot;
Index: Email.pm
===================================================================
RCS file: /cvsroot/codestriker/codestriker/lib/Codestriker/TopicListeners/Email.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Email.pm 22 May 2006 23:19:06 -0000 1.19
+++ Email.pm 10 Jun 2006 02:58:34 -0000 1.20
@@ -17,6 +17,7 @@
use MIME::Base64;
use Sys::Hostname;
use Encode qw(encode);
+use Authen::SASL;
use Codestriker::TopicListeners::TopicListener;
@@ -443,6 +444,11 @@
my $smtp = Net::SMTP->new($Codestriker::mailhost);
defined $smtp || return "Unable to connect to mail server: $!";
+ # Perform SMTP authentication if required.
+ if (defined $Codestriker::mailuser && defined $Codestriker::mailpasswd) {
+ $smtp->auth($Codestriker::mailuser, $Codestriker::mailpasswd);
+ }
+
$smtp->mail($from);
$smtp->ok() || return "Couldn't set sender to \"$from\" $!, " .
$smtp->message();
|