Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
8e8d8344
Commit
8e8d8344
authored
16 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
bug 1221:
Made more robust in case a variable like PYTHONPATH is undefined
parent
65f2a736
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/Tools/src/lofarinit.csh
+25
-13
25 additions, 13 deletions
LCS/Tools/src/lofarinit.csh
with
25 additions
and
13 deletions
LCS/Tools/src/lofarinit.csh
+
25
−
13
View file @
8e8d8344
...
@@ -44,12 +44,18 @@ else
...
@@ -44,12 +44,18 @@ else
# Take care that a possible . is preceeded by a backslash.
# Take care that a possible . is preceeded by a backslash.
if ($?LOFARROOT) then
if ($?LOFARROOT) then
set a_path = `echo $LOFARROOT | sed -e 's/\./\\\./g'`
set a_path = `echo $LOFARROOT | sed -e 's/\./\\\./g'`
set a_bin = "$a_path/bin"
if ($?PATH) then
setenv PATH `echo $PATH | sed -e "s%:${a_bin}:%:%g" -e "s%^${a_bin}:%%" -e "s%:${a_bin}"'$%%' -e "s%^${a_bin}"'$%%'`
set a_bin = "$a_path/bin"
set a_lib = "$a_path/lib"
setenv PATH `echo $PATH | sed -e "s%:${a_bin}:%:%g" -e "s%^${a_bin}:%%" -e "s%:${a_bin}"'$%%' -e "s%^${a_bin}"'$%%'`
setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | sed -e "s%:${a_lib}:%:%g" -e "s%^${a_lib}:%%" -e "s%:${a_lib}"'$%%' -e "s%^${a_lib}"'$%%'`
endif
set a_pyt = "$a_path/lib/python$a_pyvv/site-packages"
if ($?LD_LIBRARY_PATH) then
setenv PYTHONPATH `echo $PYTHONPATH | sed -e "s%:${a_pyt}:%:%g" -e "s%^${a_pyt}:%%" -e "s%:${a_pyt}"'$%%' -e "s%^${a_pyt}"'$%%'`
set a_lib = "$a_path/lib"
setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | sed -e "s%:${a_lib}:%:%g" -e "s%^${a_lib}:%%" -e "s%:${a_lib}"'$%%' -e "s%^${a_lib}"'$%%'`
endif
if ($?PYTHONPATH) then
set a_pyt = "$a_path/lib/python$a_pyvv/site-packages"
setenv PYTHONPATH `echo $PYTHONPATH | sed -e "s%:${a_pyt}:%:%g" -e "s%^${a_pyt}:%%" -e "s%:${a_pyt}"'$%%' -e "s%^${a_pyt}"'$%%'`
endif
endif
endif
# Now define the new LOFARROOT
# Now define the new LOFARROOT
...
@@ -58,13 +64,19 @@ else
...
@@ -58,13 +64,19 @@ else
# Also strip this path from the current paths (in case it is contained in
# Also strip this path from the current paths (in case it is contained in
# it).
# it).
set a_path = `echo $LOFARROOT | sed -e 's/\./\\\./g'`
set a_path = `echo $LOFARROOT | sed -e 's/\./\\\./g'`
set a_bin = "$a_path/bin"
if ($?PATH) then
setenv PATH `echo $PATH | sed -e "s%:${a_bin}:%:%g" -e "s%^${a_bin}:%%" -e "s%:${a_bin}"'$%%' -e "s%^${a_bin}"'$%%'`
set a_bin = "$a_path/bin"
set a_lib = "$a_path/lib"
setenv PATH `echo $PATH | sed -e "s%:${a_bin}:%:%g" -e "s%^${a_bin}:%%" -e "s%:${a_bin}"'$%%' -e "s%^${a_bin}"'$%%'`
setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | sed -e "s%:${a_lib}:%:%g" -e "s%^${a_lib}:%%" -e "s%:${a_lib}"'$%%' -e "s%^${a_lib}"'$%%'`
endif
set a_pyt = "$a_path/lib/python$a_pyvv/site-packages"
if ($?LD_LIBRARY_PATH) then
setenv PYTHONPATH `echo $PYTHONPATH | sed -e "s%:${a_pyt}:%:%g" -e "s%^${a_pyt}:%%" -e "s%:${a_pyt}"'$%%' -e "s%^${a_pyt}"'$%%'`
set a_lib = "$a_path/lib"
setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | sed -e "s%:${a_lib}:%:%g" -e "s%^${a_lib}:%%" -e "s%:${a_lib}"'$%%' -e "s%^${a_lib}"'$%%'`
endif
if ($?PYTHONPATH) then
set a_pyt = "$a_path/lib/python$a_pyvv/site-packages"
setenv PYTHONPATH `echo $PYTHONPATH | sed -e "s%:${a_pyt}:%:%g" -e "s%^${a_pyt}:%%" -e "s%:${a_pyt}"'$%%' -e "s%^${a_pyt}"'$%%'`
endif
# Add the path to the standard paths.
# Add the path to the standard paths.
if (! $?PATH) then
if (! $?PATH) then
setenv PATH $LOFARROOT/bin
setenv PATH $LOFARROOT/bin
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment