Skip to contentSkip to conversation

scc: Fix process_file error check

PATCH In review George McCollister 2 participants 2 messages Jan 13, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scc: Fix process_file error check

Commit 626ceac135fa66277c2fa53197be33cc9d4d7614 broke the error check in process_file by adding in three lines that stomp on $? which print the output file when verbose is set.

Move output file on verbose print to an elif after the error check.

---
 tools/scc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tools/scc +2 -4
index 4cd68a4..3d17496 100755
@@ -246,10 +246,6 @@ process_file()
         )
     )
 
-    if [ -n "${verbose}" ]; then
-        cat ${scc_output_file}
-    fi
-
     if [ $? -ne 0 ]; then
         echo "[ERROR]: processing of file $in failed"
         cat ${scc_output_file}
@@ -275,6 +271,8 @@ process_file()
         fi
 	rm -f ${scc_output_file}
         exit 1
+    elif [ -n "${verbose}" ]; then
+        cat ${scc_output_file}
     fi
 
     rm -f ${scc_output_file}
Signature · 1 line
2.11.0
#1 lore raw
Quoted 5 lines · George McCollister

Commit 626ceac135fa66277c2fa53197be33cc9d4d7614 broke the error check in process_file by adding in three lines that stomp on $? which print the output file when verbose is set.

Move output file on verbose print to an elif after the error check.

Good catch!

Merged.

My oe-core submissions are queued up at the moment, but I'll have this in my next batch.

Bruce

Quoted 31 lines
---
 tools/scc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
tools/scc +2 -4
index 4cd68a4..3d17496 100755
@@ -246,10 +246,6 @@ process_file()
         )
     )
 
-    if [ -n "${verbose}" ]; then
-        cat ${scc_output_file}
-    fi
-
     if [ $? -ne 0 ]; then
         echo "[ERROR]: processing of file $in failed"
         cat ${scc_output_file}
@@ -275,6 +271,8 @@ process_file()
         fi
 	rm -f ${scc_output_file}
         exit 1
+    elif [ -n "${verbose}" ]; then
+        cat ${scc_output_file}
     fi
 
     rm -f ${scc_output_file}