]> err.no Git - sope/blobdiff - sope-core/NGExtensions/NGBundleManager.m
added FHS install hack
[sope] / sope-core / NGExtensions / NGBundleManager.m
index 7abeb2f2cddf6c1e0110d36354c9220bfe159e4a..c2ab346f9a3452411f620af9b4526734f6cba085 100644 (file)
@@ -18,7 +18,7 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
+// $Id: NGBundleManager.m 4 2004-08-20 17:04:31Z helge $
 
 #include "NGBundleManager.h"
 #include "common.h"
@@ -307,9 +307,9 @@ static BOOL debugOn = NO;
   paths = [[pi environment] objectForKey:@"NGBundlePath"];
   if (paths) {
 #if defined(__MINGW32__)
-        paths = [paths componentsSeparatedByString:@";"];
+    paths = [paths componentsSeparatedByString:@";"];
 #else
-        paths = [paths componentsSeparatedByString:@":"];
+    paths = [paths componentsSeparatedByString:@":"];
 #endif
   }
   if (paths) [self->bundleSearchPaths addObjectsFromArray:paths];
@@ -321,25 +321,24 @@ static BOOL debugOn = NO;
     // TODO: whats that supposed to do?
     // TODO: replace with proper path locator function!
     NSDictionary *env;
-    NSString *p;
-      
+    NSString     *p;
+    unsigned     i, count;
+    id tmp;
+    
     env = [[NSProcessInfo processInfo] environment];
-    p = [[[env objectForKey:@"GNUSTEP_USER_ROOT"]
-                 stringByAppendingPathComponent:@"Library"]
-                 stringByAppendingPathComponent:@"Bundles"];
-    if (p) [self->bundleSearchPaths addObject:p];
-    p = [[[env objectForKey:@"GNUSTEP_LOCAL_ROOT"]
-                 stringByAppendingPathComponent:@"Library"]
-                 stringByAppendingPathComponent:@"Bundles"];
-    if (p) [self->bundleSearchPaths addObject:p];
-    p = [[[env objectForKey:@"GNUSTEP_NETWORK_ROOT"]
-                 stringByAppendingPathComponent:@"Library"]
-                 stringByAppendingPathComponent:@"Bundles"];
-    if (p) [self->bundleSearchPaths addObject:p];
-    p = [[[env objectForKey:@"GNUSTEP_SYSTEM_ROOT"]
-                 stringByAppendingPathComponent:@"Library"]
-                 stringByAppendingPathComponent:@"Bundles"];
-    if (p) [self->bundleSearchPaths addObject:p];
+
+    if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil)
+      tmp = [env objectForKey:@"GNUSTEP_PATHLIST"];
+    tmp = [tmp componentsSeparatedByString:@":"];
+
+    for (i = 0; i < count; i++) {
+      p = [tmp objectAtIndex:i];
+      p = [p stringByAppendingPathComponent:@"Library"];
+      p = [p stringByAppendingPathComponent:@"Bundles"];
+      if ([self->bundleSearchPaths containsObject:p]) continue;
+
+      [self->bundleSearchPaths addObject:p];
+    }
 #endif
   }