Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 8fa3c7e6fc91def126fa5c55bb2210be284e85cf)
+++ Jenkinsfile	(revision 734891d84b142d64e948f7785056879ace147b44)
@@ -9,4 +9,6 @@
 	def err = null
 	def log_needed = false
+
+	stage_name 		= ''
 
 	compiler 		= null
@@ -61,15 +63,15 @@
 
 		//Store the result of the build log
-		currentBuild.result = "${status_prefix} FAILURE".trim()
+		currentBuild.result = "${stage_name} FAILURE".trim()
 	}
 
 	finally {
-		echo 'Build Completed'
-
 		//Send email with final results if this is not a full build
-		if( !do_sendemail && !bIsSandbox ) {
+		if( (!do_sendemail) && (!bIsSandbox) ) {
 			echo 'Notifying users of result'
 			email(currentBuild.result, log_needed)
 		}
+
+		echo 'Build Completed'
 
 		/* Must re-throw exception to propagate error */
@@ -165,4 +167,9 @@
 }
 
+def build_stage(String name) {
+	stage_name = name
+	stage name
+}
+
 def notify_server() {
 	sh 'curl --silent -X POST http://plg2:8082/jenkins/notify > /dev/null'
@@ -235,5 +242,5 @@
 //Compilation script is done here but environnement set-up and error handling is done in main loop
 def checkout() {
-	stage 'Checkout'
+	build_stage'Checkout'
 		//checkout the source code and clean the repo
 		checkout scm
@@ -247,5 +254,5 @@
 
 def build() {
-	stage 'Build'
+	build_stage'Build'
 	
 		def install_dir = pwd tmp: true
@@ -262,5 +269,5 @@
 
 def test() {
-	stage 'Test'
+	build_stage'Test'
 
 		//Run the tests from the tests directory
@@ -275,5 +282,5 @@
 
 def benchmark() {
-	stage 'Benchmark'
+	build_stage'Benchmark'
 
 		if( !do_benchmark ) return
@@ -287,5 +294,5 @@
 
 def clean() {
-	stage 'Cleanup'
+	build_stage'Cleanup'
 
 		//do a maintainer-clean to make sure we need to remake from scratch
@@ -294,5 +301,5 @@
 
 def build_doc() {
-	stage 'Documentation'
+	build_stage'Documentation'
 
 		if( !do_doc ) return
@@ -308,5 +315,5 @@
 
 def publish() {
-	stage 'Publish'
+	build_stage'Publish'
 
 		if( !do_publish ) return
