From 373ed0016e01aaf8c62d75015899c449d08ec332 Mon Sep 17 00:00:00 2001 From: Nicola Pero Date: Thu, 4 Apr 2002 15:52:35 +0000 Subject: [PATCH] Tidied up setting PATH and CLASSPATH to avoid spurious : at the end of vars git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/tools/make/trunk@13354 72102866-910b-0410-8b05-ffd578937521 --- GNUstep.sh.in | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/GNUstep.sh.in b/GNUstep.sh.in index 92e6cd28..4181fde0 100755 --- a/GNUstep.sh.in +++ b/GNUstep.sh.in @@ -175,11 +175,23 @@ tmp_IFS="$IFS" IFS=: temp_path= for dir in $GNUSTEP_PATHPREFIX_LIST; do - temp_path="$temp_path$dir/Tools:" + + # Prepare the path_fragment if [ -z "$GNUSTEP_FLATTENED" ]; then - temp_path="$temp_path$dir/Tools/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}/${LIBRARY_COMBO}:" - temp_path="$temp_path$dir/Tools/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}:" + path_fragment="$dir/Tools:$dir/Tools/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}/${LIBRARY_COMBO}:$dir/Tools/${GNUSTEP_HOST_CPU}/${GNUSTEP_HOST_OS}" + else + path_fragment="$dir/Tools" fi + + # Add it to temp_path + if [ -z "$temp_path" ]; then + temp_path="$path_fragment" + else + temp_path="$temp_path:$path_fragment" + fi + + unset path_fragment + done IFS="$tmp_IFS" unset tmp_IFS @@ -188,7 +200,7 @@ if [ -z "$PATH" ]; then PATH="$temp_path" else if ( echo ${PATH}| grep -v "${temp_path}" >/dev/null ); then - PATH="${temp_path}${PATH}" + PATH="${temp_path}:${PATH}" fi fi unset temp_path @@ -200,8 +212,13 @@ tmp_IFS="$IFS" IFS=: gnustep_class_path= for dir in $GNUSTEP_PATHPREFIX_LIST; do - # FIXME - ugly to add the ':' at the end of the CLASSPATH - gnustep_class_path="$gnustep_class_path$dir/Libraries/Java:" + + if [ -z "$gnustep_class_path" ]; then + gnustep_class_path="$dir/Libraries/Java" + else + gnustep_class_path="$gnustep_class_path:$dir/Libraries/Java" + fi + done IFS="$tmp_IFS" unset tmp_IFS