Mailing List Archive

r3866 - trunk/devel/bin
Author: creamyg
Date: 2008-09-10 17:09:13 -0700 (Wed, 10 Sep 2008)
New Revision: 3866

Modified:
trunk/devel/bin/smoke.pl
Log:
Have smoke.pl require a "to" address rather than sending email by default.
Merge supplied conf with defaults hash. Fix crash affecting fresh repository
checkouts. Fix subject glitch in email.


Modified: trunk/devel/bin/smoke.pl
===================================================================
--- trunk/devel/bin/smoke.pl 2008-09-10 22:40:40 UTC (rev 3865)
+++ trunk/devel/bin/smoke.pl 2008-09-11 00:09:13 UTC (rev 3866)
@@ -9,19 +9,18 @@
use Sys::Hostname;

my $config = {
- src => Path::Class::Dir->new( $FindBin::Bin , '../../' )->absolute->stringify,
- verbose => 0,
- email => {
- to => 'kinosmoke@rectangular.com',
- from => getpwuid($<) . '@' . hostname(),
- subject => 'KinoSearch Smoke Test Report ' . localtime(),
- },
- test_target => 'test', # could also be 'test_valgrind' if on Linux
+ src => Path::Class::Dir->new( $FindBin::Bin, '../../' )->absolute->stringify,
+ verbose => 0,
+ email_to => undef,
+ email_from => getpwuid($<) . '@' . hostname(),
+ email_subject => 'KinoSearch Smoke Test Report ' . localtime(),
+ test_target => 'test', # could also be 'test_valgrind' if on Linux
};

if (@ARGV) {
- my $config_file = Path::Class::File->new( shift @ARGV );
- $config = decode_json( $config_file->slurp );
+ my $config_file = Path::Class::File->new( shift @ARGV );
+ my $supplied_conf = decode_json( $config_file->slurp );
+ $config = { %$config, %$supplied_conf };
}

if (!$config->{src}) {
@@ -38,7 +37,7 @@
$dir->update or croak "can't svn update $dir:\n" . $dir->errstr;
chdir "$dir" or croak "can't chdir to $dir: $!";
chdir 'perl' or croak "can't chdir to perl: $!";
-run_quiet("./Build clean");
+run_quiet("./Build clean") if -f 'Build';
run_quiet("$^X Build.PL");
run_quiet("$^X Build");
my $test_info = get_out("./Build $test_target");
@@ -56,9 +55,10 @@
if ($ENV{SMOKE_TEST}) {
print $msg . "\n";
}
- else {
- Email::Stuff->from ( $config->{email}->{from} )
- ->to ( $config->{email}->{to} )
+ elsif ( $config->{email_to} ) {
+ Email::Stuff->from ( $config->{email_from} )
+ ->to ( $config->{email_to} )
+ ->subject ( $config->{email_subject} )
->text_body( $msg )
->send;
}


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits