Skip to contentSkip to conversation

ADT: Fix script check_result error

PATCH Applied Liping Ke 2 participants 3 messages Feb 21, 2011

lore
Share & tools
lore

Liping Ke

author
#0 lore raw

cover ADT: Fix script check_result error

From: Liping Ke <[email protected]>

When meeting errors, the return number can't be directly compared with "-1". The correct way is to compare it with 0. If the result is a non-zero number, we meet error. This patch is for fixing [BUGID #742]

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: lke/adt-fix
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lke/adt-fix

Thanks,
Liping Ke <[email protected]>
---

Liping Ke (1):
ADT: Fix check_result script cond comparison bug

 .../installer/adt-installer/scripts/util           |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
author
#1 lore raw

PATCH 1/1 ADT: Fix check_result script cond comparison bug

From: Liping Ke <[email protected]>

When meeting errors, the return number can't be directly compared with "-1". The correct way is to compare it with 0. If the result is a non-zero number, we meet error. This patch is for fixing [BUGID #742]

---
 .../installer/adt-installer/scripts/util           |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-devtools/installer/adt-installer/scripts/util +4 -4
index 4b88fee..9be7517 100644
@@ -84,14 +84,14 @@ done
 
 check_result()
 {
-  result="$?"
-  if [  "$result" == "-1" ]; then
+  result=$?
+  if [ $result -eq 1 ]; then
+    exit -1
+  elif [  $result -ne 0 ]; then
      echo_info "\n#############################################################################"
      echo_info "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
      echo_info "#############################################################################\n"
     exit -1
-  elif [ "$result" == "1" ]; then
-    exit -1
   fi
 }
 
Signature · 1 line
1.7.0.4
#2 lore raw
In reply to Liping Ke
Quoted 16 lines · Liping Ke

From: Liping Ke <[email protected]>

When meeting errors, the return number can't be directly compared with "-1". The correct way is to compare it with 0. If the result is a non-zero number, we meet error. This patch is for fixing [BUGID #742]

Pull URL: git://git.pokylinux.org/poky-contrib.git
Branch: lke/adt-fix
Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=lke/adt-fix

Thanks,
Liping Ke <[email protected]>
---

Quoted 5 lines

Liping Ke (1):
ADT: Fix check_result script cond comparison bug

 .../installer/adt-installer/scripts/util           |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Merged to master, thanks.

Richard