Generating setenv.csh with all variables expanded.

This commit is contained in:
alba 2002-08-04 15:24:50 +00:00
parent 85805bcf33
commit 31a742d065
1 changed files with 37 additions and 8 deletions

View File

@ -329,9 +329,9 @@ patch_xsl()
}
#
# patch_setenv
# patch_setenv_sh
#
patch_setenv()
patch_setenv_sh()
{
local file=$1
local prefix='^[[:space:]]*export[[:space:]]*LAMPADAS_'
@ -350,6 +350,38 @@ patch_setenv()
return 0
}
#
# create_setenv_csh
#
create_setenv_csh()
{
local input=$1
local output=$2
local prefix='^[[:space:]]*export[[:space:]]*'
echo -n "Sourcing in ${input} ... "
(
. ${input}
echo "Ok."
echo -n "Generating ${output} ... "
(
echo "# Generated by configure. Do not modify."
echo ""
sed -ne "s/${prefix}\([[:alnum:]_]*\)=.*/\1/p" \
< ${input} \
| while read var
do
echo "setenv ${var} \"${!var}\""
done
) > ${output}
echo "Ok."
return 0
)
return 1
}
#
# main
#
@ -381,7 +413,7 @@ check_xsltproc
check_html_parser
check_which count wt2db
check_python count
check_python_import os pyPgSQL
check_python_import os pyPgSQL # DateTime
if [ ${CHECK_ERROR} -ne 0 ]; then
echo "${CHECK_ERROR} errors."
@ -390,8 +422,5 @@ fi
echo "No errors."
patch_xsl || exit -1
patch_setenv bin/setenv.sh || exit -1
echo -e "Creating bin/setenv.csh ... "
sed -e 's/^export/setenv/' -e 's/=/ /' bin/setenv.sh \
> bin/setenv.csh \
&& echo "Ok."
patch_setenv_sh bin/setenv.sh || exit -1
create_setenv_csh bin/setenv.sh bin/setenv.csh || exit -1