defect 3137

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16996 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2013-07-17 18:17:27 +00:00
parent ee1ec2e91f
commit 97db7efd56

View File

@ -372,10 +372,13 @@ fi
##end collecting the repositories for os
#########################
echo NFSSERVER=$NFSSERVER
if [ $VERBOSE ]; then
echo NFSSERVER=$NFSSERVER
fi
logger -p local4.info -t xcat "NFSSERVER=$NFSSERVER"
echo OTHERPKGDIR=$OTHERPKGDIR
if [ $VERBOSE ]; then
echo OTHERPKGDIR=$OTHERPKGDIR
fi
logger -p local4.info -t xcat "OTHERPKGDIR=$OTHERPKGDIR"
#if [ -x "/sbin/dhcpcd" ]; then
@ -444,8 +447,10 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then
if [ $? -ne 0 ]; then
if ( ! pmatch "$result" "*exists*" ); then
logger -t xcat -p local4.info "ospkgs: zypper ar $path xCAT-$OSVER\n $result"
echo "ospkgs: zypper ar $path xCAT-$OSVER"
echo " $result"
if [ $VERBOSE ]; then
echo "ospkgs: zypper ar $path xCAT-$OSVER"
echo " $result"
fi
fi
fi
else
@ -460,8 +465,10 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then
if [ $? -ne 0 ]; then
if ( ! pmatch "$result" "*exists*" ); then
logger -t xcat -p local4.info "ospkgs: zypper ar $path xCAT-$OSVER-path$i\n $result"
if [ $VERBOSE ]; then
echo "ospkgs: zypper ar $path xCAT-$OSVER-path$i"
echo " $result"
fi
fi
fi
@ -479,8 +486,10 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then
if [ $? -ne 0 ]; then
if ( ! pmatch "$result" "*exists*" ); then
logger -t xcat -p local4.info "ospkgs: zypper ar $SDKDIR xCAT-$OSVER-sdk\n $result"
echo "ospkgs: zypper ar $SDKDIR xCAT-$OSVER-sdk"
echo " $result"
if [ $VERBOSE ]; then
echo "ospkgs: zypper ar $SDKDIR xCAT-$OSVER-sdk"
echo " $result"
fi
fi
fi
fi
@ -719,16 +728,22 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
#now update all the existing rpms
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y upgrade"
if [ $VERBOSE ]; then
echo "$envlist yum -y upgrade"
fi
result=`eval $envlist yum -y upgrade 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper --non-interactive update --auto-agree-with-license"
if [ $VERBOSE ]; then
echo "$envlist zypper --non-interactive update --auto-agree-with-license"
fi
result=`eval $envlist zypper --non-interactive update --auto-agree-with-license 2>&1`
R=$?
@ -736,17 +751,23 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "$envlist apt-get -y upgrade"
if [ $VERBOSE ]; then
echo "$envlist apt-get -y upgrade"
fi
result=`eval $envlist apt-get -y upgrade 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
#echo "repo_pkgs=$repo_pkgs,\nrepo_pkgs_preremove=$repo_pkgs_preremove,\nrepo_pkgs_postremove=$repo_pkgs_postremove"
@ -756,68 +777,92 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
#Now we have parsed the input, let's remove rpms if is specified with -
if [ "$repo_pkgs_preremove" != "" ]; then
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y remove $repo_pkgs_preremove"
if [ $VERBOSE ]; then
echo "$envlist yum -y remove $repo_pkgs_preremove"
fi
result=`eval $envlist yum -y remove $repo_pkgs_preremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper remove -y $repo_pkgs_preremove"
if [ $VERBOSE ]; then
echo "$envlist zypper remove -y $repo_pkgs_preremove"
fi
result=`eval $envlist zypper remove -y $repo_pkgs_preremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "apt-get -y remove $repo_pkgs_preremove"
if [ $VERBOSE ]; then
echo "apt-get -y remove $repo_pkgs_preremove"
fi
result=`apt-get -y remove $repo_pkgs_preremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
fi
if [ "$plain_pkgs_preremove" != "" ]; then
echo "$envlist $sremovecommand $plain_pkgs_preremove"
if [ $VERBOSE ]; then
echo "$envlist $sremovecommand $plain_pkgs_preremove"
fi
result=`eval $envlist $sremovecommand $plain_pkgs_preremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
#installation using yum or zypper
if [ "$repo_pkgs" != "" ]; then
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y install $repo_pkgs"
if [ $VERBOSE ]; then
echo "$envlist yum -y install $repo_pkgs"
fi
result=`eval $envlist yum -y install $repo_pkgs 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper install -y $repo_pkgs"
if [ $VERBOSE ]; then
echo "$envlist zypper install -y $repo_pkgs"
fi
result=`eval $envlist zypper install -y $repo_pkgs 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
#remove the repos
#old_repo=`zypper lr -u |grep xcat-otherpkgs | cut -f2 -d '|'`
#for x in $old_repo
@ -825,15 +870,19 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
# result=`zypper sd $x`
#done
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "$envlist apt-get -q -y --force-yes install $repo_pkgs"
apt_get_update_if_repos_changed $REPOFILE
if [ $VERBOSE ]; then
echo "$envlist apt-get -q -y --force-yes install $repo_pkgs"
fi
result=`eval $envlist apt-get -q -y --force-yes install $repo_pkgs 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
fi
@ -859,14 +908,18 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
cd $OTHERPKGDIR
fi
echo "$envlist $supdatecommand $plain_pkgs"
if [ $VERBOSE ]; then
echo "$envlist $supdatecommand $plain_pkgs"
fi
result=`eval $envlist $supdatecommand $plain_pkgs 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
if [ $mounted -eq 0 ]; then
cd /xcatpost
@ -879,45 +932,61 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
#remove more rpms if specified with --
if [ "$repo_pkgs_postremove" != "" ]; then
if [ $hasyum -eq 1 ]; then
echo "$envlist yum -y remove $repo_pkgs_postremove"
if [ $VERBOSE ]; then
echo "$envlist yum -y remove $repo_pkgs_postremove"
fi
result=`eval $envlist yum -y remove $repo_pkgs_postremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $haszypper -eq 1 ]; then
echo "$envlist zypper remove -y $repo_pkgs_postremove"
if [ $VERBOSE ]; then
echo "$envlist zypper remove -y $repo_pkgs_postremove"
fi
result=`eval $envlist zypper remove -y $repo_pkgs_postremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
elif [ $hasapt -eq 1 ]; then
apt_get_update_if_repos_changed $REPOFILE
echo "$envlist apt-get -y remove $repo_pkgs_postremove"
if [ $VERBOSE ]; then
echo "$envlist apt-get -y remove $repo_pkgs_postremove"
fi
result=`eval $envlist apt-get -y remove $repo_pkgs_postremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
fi
if [ "$plain_pkgs_postremove" != "" ]; then
echo "$envlist $sremovecommand $plain_pkgs_postremove"
if [ $VERBOSE ]; then
echo "$envlist $sremovecommand $plain_pkgs_postremove"
fi
result=`eval $envlist $sremovecommand $plain_pkgs_postremove 2>&1`
R=$?
if [ $R -ne 0 ]; then
RETURNVAL=$R
fi
logger -p local4.info -t xcat "$result"
echo "$result"
if [ $VERBOSE ]; then
echo "$result"
fi
fi
op_index=$((op_index+1))