fix defect #3182, add return value for package update in "updatenode -S"

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14799 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
immarvin 2013-01-08 09:14:19 +00:00
parent 6c98b466eb
commit 95c6c2bc8a
2 changed files with 16 additions and 1 deletions

View File

@ -440,6 +440,7 @@ if ( pmatch "$OSVER" "sles10*" ); then
result=`rug update -y --agree-to-third-party-licences`
if [ $? -ne 0 ]; then
RETURNVAL=$?
logger -t xcat -p local4.info "rug update -y --agree-to-third-party-licences\n $result"
echo "ospkgs: rug update -y --agree-to-third-party-licences"
echo " $result"
@ -585,6 +586,7 @@ elif ( pmatch "$OSVER" "sles11*" ); then
#upgrade the all existing rpms
result=`zypper --non-interactive update --auto-agree-with-licenses`
if [ $? -ne 0 ]; then
RETURNVAL=$?
logger -t xcat -p local4.info "ospkgs: zypper --non-interactive update --auto-agree-with-licenses\n $result"
echo "ospkgs: zypper --non-interactive update --auto-agree-with-licenses"
echo " $result"
@ -667,7 +669,10 @@ elif ( pmatch "$OSVER" "ubuntu*" ); then
# upgrade existing packages
command="apt-get -y upgrade"
echo "=== $command"
$command
eval $command
if [ $? -ne 0 ]; then
RETURNVAL=$?
fi
# install groups (NOTE: It's not clear rpm-like "groups" are supported by dpkg/apt,
# but keeping this here doesn't really hurt. Anything that looks like a group will
@ -768,6 +773,7 @@ else
#upgrade the existing rpms
result=`yum -y upgrade 2>&1`
if [ $? -ne 0 ]; then
RETURNVAL=$?
logger -t xcat -p local4.info "ospkgs: yum -y upgrade\n $result"
echo "ospkgs: yum -y upgrade"
echo " $result"

View File

@ -481,17 +481,26 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
if [ $hasyum -eq 1 ]; then
echo "yum -y upgrade"
result=`yum -y upgrade 2>&1`
if [ $? -ne 0 ]; then
RETURNVAL=$?
fi
logger -p local4.info -t xcat "$result"
echo "result"
elif [ $haszypper -eq 1 ]; then
echo "zypper --non-interactive update --auto-agree-with-license"
result=`zypper --non-interactive update --auto-agree-with-license 2>&1`
if [ $? -ne 0 ]; then
RETURNVAL=$?
fi
logger -p local4.info -t xcat "$result"
echo "$result"
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "apt-get -y upgrade"
result=`apt-get -y upgrade 2>&1`
if [ $? -ne 0 ]; then
RETURNVAL=$?
fi
logger -p local4.info -t xcat "$result"
echo "$result"
fi