From 50df67445c398d09ff460ab5e7567e6afb0c9b51 Mon Sep 17 00:00:00 2001
From: Ger van Diepen <diepen@astron.nl>
Date: Tue, 24 Nov 2009 11:59:35 +0000
Subject: [PATCH] bug 1421: In csh cd;pwd resolves symlinks which we do not
 want. Skip it if possible.

---
 LCS/Tools/src/lofarinit.csh.in | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/LCS/Tools/src/lofarinit.csh.in b/LCS/Tools/src/lofarinit.csh.in
index 2f4c654dc12..99ca98599b9 100644
--- a/LCS/Tools/src/lofarinit.csh.in
+++ b/LCS/Tools/src/lofarinit.csh.in
@@ -70,7 +70,12 @@ else
     endif
 
     # Now define the new LOFARROOT
-    setenv LOFARROOT `cd >/dev/null $lfr_root; pwd`      # make path absolute
+    # If not needed, do not do cd;pwd because that resolves symlinks.
+    if ( $lfr_root =~ /* ) then
+        setenv LOFARROOT $lfr_root
+    else
+        setenv LOFARROOT `cd >/dev/null $lfr_root; pwd`   # make path absolute
+    endif
 
     # Also strip this path from the current paths (in case it is contained in
     # it).
-- 
GitLab