From 0cca65fd0a6a6215b36fd0091cea4991e7defbea Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 2 Jul 2009 17:03:17 +0000 Subject: [PATCH] more enhancement on otherpkgs git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3685 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/otherpkgs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/otherpkgs b/xCAT/postscripts/otherpkgs index f964c096a..a286b92be 100755 --- a/xCAT/postscripts/otherpkgs +++ b/xCAT/postscripts/otherpkgs @@ -75,6 +75,7 @@ fi repo_path=() repo_pkgs="" plain_pkgs="" +handled_path=() for x in `echo "$OTHERPKGS" | tr "," "\n"` do if [ $hasyum -eq 0 ] && [ $haszypper -eq 0 ]; then @@ -86,19 +87,27 @@ do path=`dirname $x` whole_path=$NFSSERVER/post/otherpkgs/$OSVER/$ARCH/$path - #find out if this path has already saved added in the repo + #find out if this path has already handled try_repo=1 rc=1 i=0 - while [ $i -lt ${#repo_path[*]} ]; do - if [ ${repo_path[$i]} = $path ]; then + while [ $i -lt ${#handled_path[*]} ]; do + if [ ${handled_path[$i]} = $path ]; then try_repo=0 - rc=0 + j=0 + while [ $j -lt ${#repo_path[*]} ]; do + if [ ${repo_path[$j]} = $path ]; then + rc=0 + break + fi + let j++ + done break fi let i++ done + #try to add the path to the repo if [ $try_repo -eq 1 ]; then index=${#repo_path[*]} @@ -146,6 +155,7 @@ do #now no hope we have to use rpm command plain_pkgs="$plain_pkgs $x-*" fi + handled_path[${#handled_path[*]}]=$path done #Now we have parse the input, let start the installation using yum or zypper