Skip to content

Commit 2398ca9

Browse files
committed
improved path handling
1 parent 4898369 commit 2398ca9

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

scripts/setup_engine.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ trap '_es=${?};
1919

2020
BRANCH="${1:-master}"
2121
DIR_SCRIPT="${0%/*}"
22-
DIR_TOP="${DIR_SCRIPT}/.."
22+
DIR_TOP="$(python -c \
23+
'import os.path, sys; print(os.path.normpath(sys.argv[1]))' \
24+
"${DIR_SCRIPT}/..")"
25+
DIR_ABS_TOP="$(python -c \
26+
'import os.path, sys; print(os.path.realpath(sys.argv[1]))' "${DIR_TOP}")"
2327

2428
# Change directory to project root
2529
pushd "${DIR_TOP}" >/dev/null
@@ -58,12 +62,12 @@ popd >/dev/null
5862
# Support the semantic web
5963

6064
echo 'Create symlinks to support the semantic web'
61-
ln -fns ${DIR_TOP}/python_src/cc.licenserdf \
62-
${DIR_TOP}/docroot/cc.licenserdf
63-
ln -fns ${DIR_TOP}/docroot/cc.licenserdf/cc/licenserdf/rdf \
64-
${DIR_TOP}/docroot/rdf
65+
ln -fns python_src/cc.licenserdf \
66+
docroot/cc.licenserdf
67+
ln -fns docroot/cc.licenserdf/cc/licenserdf/rdf \
68+
docroot/rdf
6569
ln -fns ${DIR_TOP}/docroot/cc.licenserdf/cc/licenserdf/licenses \
66-
${DIR_TOP}/docroot/license_rdf
70+
/docroot/license_rdf
6771
echo
6872

6973
###############################################################################
@@ -90,7 +94,7 @@ then
9094
echo '*skipping* Generate ccengine.fcgi (already exists)'
9195
else
9296
echo 'Generate ccengine.fcgi'
93-
sed -e "s|@env_dir@|${DIR_TOP}/python_env|" \
97+
sed -e "s|@env_dir@|${DIR_ABS_TOP}/python_env|" \
9498
< "python_src/bin/ccengine.fcgi.in" \
9599
> "python_env/bin/ccengine.fcgi"
96100
chmod 755 python_env/bin/ccengine.fcgi

0 commit comments

Comments
 (0)