summaryrefslogtreecommitdiff
blob: 6c5dc422af94090604aa56a593bcc4921c9c37b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
--- GNUstep-reset.sh	2004-11-07 21:42:49.000000000 -0500
+++ GNUstep-reset.sh	2004-11-08 01:19:30.717795904 -0500
@@ -34,30 +34,43 @@
 # GNUSTEP_NETWORK_ROOT and GNUSTEP_USER_ROOT are removed from the path
 # variable (yes, we are rather crude).  All other paths are kept
 # unchanged.
+
 function reset_path 
 {
   # Declare local variables
   local original_path tmp_IFS temp_path dir gnustep_dir found
 
-  # NB: We need to use eval because we want to access a variable
-  # whose name is another variable!
-  original_path=$(eval echo \$$1)
-  tmp_IFS="$IFS"
+  if [ -z "$1" ]; then
+    echo "Warning: ${FUNCNAME} called without an argument."
+    echo "This is a bug."
+  fi
+
+  if [ -z "$2" ]; then
+    echo "Warning: ${FUNCNAME} called without an argument."
+    echo "This is a bug (2)."
+  fi
+
+  original_path=${!1}
+  tmp_IFS="${IFS}"
   IFS=:
   temp_path=
+
   # Loop on the paths
   for dir in $original_path; do
     # For each of them, keep it only if it's not beginning with
     # a path in GNUSTEP_PATHLIST as prefix
     found=no;
     for gnustep_dir in $GNUSTEP_PATHLIST; do
-      if [ -n "$gnustep_dir" ]; then
-        case "$dir" in
-          $gnustep_dir*)  found=yes; break;;
+      if [ -n "$gnustep_dir$2" ]; then
+        case "$dir/" in
+          $gnustep_dir$2*)
+	    found=yes;
+	    break;;
           *);;
         esac;
       fi;
     done;
+
     if [ "$found" = "no" ]; then
       if [ -z "$temp_path" ]; then
         temp_path="$dir"
@@ -80,12 +93,14 @@
   fi
 }
 
-reset_path CLASSPATH
-reset_path GUILE_LOAD_PATH
-reset_path LD_LIBRARY_PATH
-reset_path DYLD_LIBRARY_PATH
-reset_path DYLD_FRAMEWORK_PATH
-reset_path PATH
+reset_path CLASSPATH /Library/Libraries/Java
+reset_path GUILE_LOAD_PATH /Library/Libraries/Guile
+reset_path LD_LIBRARY_PATH /Library/Libraries
+# ... uhmmm, these aren't in GNUstep.sh ? (11/8/04)
+# (yes, they're on Darwin, I know...;-))
+#reset_path DYLD_LIBRARY_PATH
+#reset_path DYLD_FRAMEWORK_PATH
+reset_path PATH /Tools
 
 # Make sure we destroy the reset_path function after using it - we don't
 # want to pollute the environment with it.