[Fuego] [PATCH 6/6] core: back to the original path once "test_build" done

Liu Wenlong liuwl.fnst at cn.fujitsu.com
Mon Nov 6 15:42:36 UTC 2017


It's possible that function "test_build" will change the path,
such as Funcitonal.glib2.
We need back to the current path before "touch fuego_test_succesfully_built"

Signed-off-by: Liu Wenlong <liuwl.fnst at cn.fujitsu.com>
---
 engine/scripts/functions.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
index da3415b..209b152 100755
--- a/engine/scripts/functions.sh
+++ b/engine/scripts/functions.sh
@@ -284,12 +284,16 @@ function build {
     if [ -e fuego_test_succesfully_built ]; then
         build_duration=0
     else
+        # it's possible that function "test_build" will change the path, such as Funcitonal.glib2
+        # we need back to the current path before "touch fuego_test_succesfully_built"
+        ori_path=`pwd`
         build_start_time=$(date +"%s.%N")
         call_if_present test_build
         ret=$?
         build_end_time=$(date +"%s.%N")
         build_duration=$(python -c "print $build_end_time - $build_start_time")
         if [ $ret -eq 0 ]; then
+            cd $ori_path
             touch fuego_test_succesfully_built
         else
             abort_job "ERROR: test_build returned $ret"
-- 
2.7.4





More information about the Fuego mailing list