From 4b75091d39c9d81da33a953114535b89b10bd13e Mon Sep 17 00:00:00 2001 From: crouzet Date: Wed, 30 Nov 2005 16:35:52 +0000 Subject: [PATCH] bug on environment file update --- scripts/SA_build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/SA_build b/scripts/SA_build index 5c1328a..715b9fd 100755 --- a/scripts/SA_build +++ b/scripts/SA_build @@ -227,13 +227,15 @@ build_source_dir() update_environ() { cp ${ENVIRON_FILE} ${ENVIRON_FILE}.old - grep " $1" ${ENVIRON_FILE}.old + grep " $1" ${ENVIRON_FILE}.old > /dev/null if [ $? -eq 0 ] then # if variable is already set, we replace old setting by new one cat ${ENVIRON_FILE}.old | awk -v var_root_dir=$1 -v path=$2 -v src_root_dir=$3 -v src_dir=$4 ' - $1=="export" && $2 ~ var_root_dir {print "#"$0; $0="export "var_root_dir "=" path} - $1=="export" && $2 ~ src_root_dir {print "#"$0; $0="export "src_root_dir "=" src_dir} + $1=="export" && $2 ~ "^"var_root_dir"=" {print "#"$0; $0="export "var_root_dir "=" path} + $1=="export" && $2 ~ "^"src_root_dir"=" {print "#"$0; $0="export "src_root_dir "=" src_dir} + $1 ~ "^"var_root_dir"=" {print "#"$0; $0=var_root_dir "=" path} + $1 ~ "^"src_root_dir"=" {print "#"$0; $0=src_root_dir "=" src_dir} { print $0}' > ${ENVIRON_FILE} else echo -e "##\n#------ ${SOURCE_NAME}-Src ------\nexport $3=$4" >> ${ENVIRON_FILE} -- 2.39.2