Blame SOURCES/reboot-in-phase.patch

e965a0
diff --git a/src/journal.sh b/src/journal.sh
e965a0
index 516f292..0ad9913 100644
e965a0
--- a/src/journal.sh
e965a0
+++ b/src/journal.sh
e965a0
@@ -118,7 +131,6 @@ rlJournalStart(){
e965a0
     export __INTERNAL_PERSISTENT_DATA="$BEAKERLIB_DIR/PersistentData"
e965a0
     export __INTERNAL_TEST_RESULTS="$BEAKERLIB_DIR/TestResults"
e965a0
     export __INTERNAL_JOURNAL_OPEN=''
e965a0
-    __INTERNAL_PersistentDataLoad
e965a0
     export __INTERNAL_PHASES_FAILED=0
e965a0
     export __INTERNAL_PHASES_PASSED=0
e965a0
     export __INTERNAL_PHASES_SKIPPED=0
e965a0
@@ -130,16 +142,20 @@ rlJournalStart(){
e965a0
     __INTERNAL_PHASE_STARTTIME=()
e965a0
     __INTERNAL_PHASE_METRICS=()
e965a0
     export __INTERNAL_PHASE_OPEN=0
e965a0
+    __INTERNAL_PersistentDataLoad
e965a0
 
e965a0
     if [[ -z "$__INTERNAL_JOURNAL_OPEN" ]]; then
e965a0
       # Create Header for XML journal
e965a0
       __INTERNAL_CreateHeader
e965a0
       # Create log element for XML journal
e965a0
-      __INTERNAL_WriteToMetafile log
e965a0
+      __INTERNAL_WriteToMetafile log || {
e965a0
+        __INTERNAL_LogText "could not write to metafile" FATAL
e965a0
+        exit 1
e965a0
+      }
e965a0
+      __INTERNAL_JOURNAL_OPEN=1
e965a0
+      # Increase level of indent
e965a0
+      __INTERNAL_METAFILE_INDENT_LEVEL=1
e965a0
     fi
e965a0
-    __INTERNAL_JOURNAL_OPEN=1
e965a0
-    # Increase level of indent
e965a0
-    __INTERNAL_METAFILE_INDENT_LEVEL=1
e965a0
 
e965a0
     # display a warning message if run in POSIX mode
e965a0
     if [ $POSIXFIXED == "YES" ] ; then
e965a0
@@ -938,20 +957,30 @@ __INTERNAL_PrintHeadLog() {
e965a0
 # should be called before and after that respectively.
e965a0
 
e965a0
 __INTERNAL_PersistentDataSave() {
e965a0
-  cat > "$__INTERNAL_PERSISTENT_DATA" <
e965a0
-__INTERNAL_STARTTIME=$__INTERNAL_STARTTIME
e965a0
-__INTERNAL_TEST_STATE=$__INTERNAL_TEST_STATE
e965a0
-__INTERNAL_PHASES_PASSED=$__INTERNAL_PHASES_PASSED
e965a0
-__INTERNAL_PHASES_FAILED=$__INTERNAL_PHASES_FAILED
e965a0
-__INTERNAL_PHASES_SKIPPED=$__INTERNAL_PHASES_SKIPPED
e965a0
-__INTERNAL_JOURNAL_OPEN=$__INTERNAL_JOURNAL_OPEN
e965a0
-__INTERNAL_PHASES_WORST_RESULT=$__INTERNAL_PHASES_WORST_RESULT
e965a0
-EOF
e965a0
-declare -p __INTERNAL_PHASE_FAILED >> $__INTERNAL_PERSISTENT_DATA
e965a0
-declare -p __INTERNAL_PHASE_PASSED >> $__INTERNAL_PERSISTENT_DATA
e965a0
-declare -p __INTERNAL_PHASE_STARTTIME >> $__INTERNAL_PERSISTENT_DATA
e965a0
-declare -p __INTERNAL_PHASE_TXTLOG_START >> $__INTERNAL_PERSISTENT_DATA
e965a0
-declare -p __INTERNAL_PHASE_METRICS >> $__INTERNAL_PERSISTENT_DATA
e965a0
+  local var
e965a0
+  (
e965a0
+    for var in \
e965a0
+     __INTERNAL_STARTTIME \
e965a0
+     __INTERNAL_TEST_STATE \
e965a0
+     __INTERNAL_PHASES_PASSED \
e965a0
+     __INTERNAL_PHASES_FAILED \
e965a0
+     __INTERNAL_PHASES_SKIPPED \
e965a0
+     __INTERNAL_JOURNAL_OPEN \
e965a0
+     __INTERNAL_PHASE_OPEN \
e965a0
+     __INTERNAL_PHASES_WORST_RESULT \
e965a0
+     __INTERNAL_METAFILE_INDENT_LEVEL \
e965a0
+     __INTERNAL_PHASE_TYPE \
e965a0
+     __INTERNAL_PHASE_NAME \
e965a0
+     __INTERNAL_PHASE_FAILED \
e965a0
+     __INTERNAL_PHASE_PASSED \
e965a0
+     __INTERNAL_PHASE_STARTTIME \
e965a0
+     __INTERNAL_PHASE_TXTLOG_START \
e965a0
+     __INTERNAL_PHASE_METRICS \
e965a0
+     ;
e965a0
+    do
e965a0
+      declare -p $var
e965a0
+    done
e965a0
+  ) | sed -r 's/declare/\0 -g/' > "$__INTERNAL_PERSISTENT_DATA"
e965a0
 }
e965a0
 
e965a0
 __INTERNAL_PersistentDataLoad() {