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"
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];
// 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
}