From 8ef5d6348cbaab385b2027157428351bf0a096ea Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Thu, 5 Jul 2007 02:06:53 +0000 Subject: [PATCH] only send mail if there were errors, or artifacts git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@553362 13f79535-47bb-0310-9956-ffa450edef68 --- maven-meeper/src/bin/synchronize/syncopate/sync | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/maven-meeper/src/bin/synchronize/syncopate/sync b/maven-meeper/src/bin/synchronize/syncopate/sync index 002d9dc0b..af682fbe6 100755 --- a/maven-meeper/src/bin/synchronize/syncopate/sync +++ b/maven-meeper/src/bin/synchronize/syncopate/sync @@ -168,6 +168,8 @@ sub runRsync() open( SYNC, "$cmd 2>&1 |" ); my $rawReportText; + + my $sendMail = 0; while( ) { @@ -187,6 +189,8 @@ sub runRsync() print REPORT "" . $details[3] . " " . $details[4] . "" . "\n"; print REPORT "" . "\n"; + + $sendMail = 1; } else { @@ -195,6 +199,14 @@ sub runRsync() print RAW_REPORT; } } + + close SYNC; + my $exitCode = $?; + + if ( $exitCode != 0 ) + { + $sendMail = 1; + } print REPORT "" . "\n"; @@ -210,8 +222,7 @@ sub runRsync() close( RAW_REPORT ); - if ( $rawReportText ) - + if ( $rawReportText and $sendMail != 0 ) { $rawReportText = $rawReportText . "\n\nYou can view the syncronization reports for today here: \n\n"; -- 2.39.5