From f79c088a43b5bcd41c5f0cfb3f5424de56f4b81a Mon Sep 17 00:00:00 2001 From: immarvin Date: Sun, 25 Nov 2012 03:05:26 +0000 Subject: [PATCH] add proper return value git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14420 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/otherpkgs.ubuntu | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/xCAT/postscripts/otherpkgs.ubuntu b/xCAT/postscripts/otherpkgs.ubuntu index a7c5d90e4..5a8bb3e30 100755 --- a/xCAT/postscripts/otherpkgs.ubuntu +++ b/xCAT/postscripts/otherpkgs.ubuntu @@ -76,6 +76,7 @@ logger -t xcat -p local4.info "OTHERPKGDIR=$OTHERPKGDIR" #check if the node has yum or zypper installed, it will try yum first, then zypper and last rpm # for rpm based machines, or check if apt is installed, then it will use apt then dpkg +RETURNVAL=0 hasrpm=0 hasyum=0 haszypper=0 @@ -317,6 +318,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`yum -y remove $repo_pkgs_preremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -325,6 +327,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`zypper remove -y $repo_pkgs_preremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -336,6 +339,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`$sremovecommand $plain_pkgs_preremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs $result" fi echo "$result" @@ -349,6 +353,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`yum -y install $repo_pkgs 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -357,6 +362,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`zypper install -y $repo_pkgs 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -371,6 +377,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`apt-get -q -y --force-yes install $repo_pkgs 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -422,6 +429,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`yum -y remove $repo_pkgs_postremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -430,6 +438,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`zypper remove -y $repo_pkgs_postremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -438,6 +447,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`apt-get -y remove $repo_pkgs_postremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs: $result" fi echo "$result" @@ -449,6 +459,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do result=`$sremovecommand $plain_pkgs_postremove 2>&1` logger -t xcat -p local4.info "$result" if [ $? -ne 0 ]; then + RETURNVAL=$? logger -t xcat -p local4.info "otherpkgs $result" fi echo "$result" @@ -457,5 +468,5 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do let op_index=$op_index+1 done -exit 0 +exit $RETURNVAL