From a2247f0170eae3e0cff5b17a4b366f0d9e4c8043 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 17 Apr 2013 07:05:21 +0000 Subject: [PATCH] fixed bug 3506, at the beginning of the ospkgs/otherpkgs, only remove the repos which are created by xCAT. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15998 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/ospkgs | 2 +- xCAT/postscripts/otherpkgs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/ospkgs b/xCAT/postscripts/ospkgs index 1ecf66855..5a36e7c01 100755 --- a/xCAT/postscripts/ospkgs +++ b/xCAT/postscripts/ospkgs @@ -706,7 +706,7 @@ else result=`rm /etc/yum.repos.d/local-repository.repo 2>&1` fi rm /etc/yum.repos.d/$OSVER-path*.repo >/dev/null 2>&1 - result=`rm /etc/yum.repos.d/xCAT*.repo 2>&1` + result=`rm /etc/yum.repos.d/xCAT-$OSVER-path*.repo 2>&1` fi diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index 256e7051f..df5f391c1 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -424,7 +424,9 @@ if ( pmatch "$OSVER" "sles11*" && [ $haszypper -eq 1 ] ); then old_repo=`zypper lr |grep -e "^[0-9]" | cut -f2 -d '|'` for x in $old_repo do - result=`zypper rr $x` + if ( ( pmatch "$x" "xCAT-$OSVER-path*" ) || ( pmatch "$x" "$OSVER-path*" ) ); then + result=`zypper rr "$x"` + fi done result=`zypper --non-interactive refresh 2>&1` @@ -491,7 +493,8 @@ elif ( pmatch "$OSVER" "rhel*" && [ $hasyum -eq 1 ] ); then if [ -r "/etc/yum.repos.d/local-repository.repo" ]; then result=`rm /etc/yum.repos.d/local-repository.repo 2>&1` fi - result=`rm /etc/yum.repos.d/xCAT*.repo 2>&1` + rm /etc/yum.repos.d/$OSVER-path*.repo >/dev/null 2>&1 + result=`rm /etc/yum.repos.d/xCAT-$OSVER-path*.repo 2>&1` result=`yum clean all`