From 918a002c2c1b37670484c8b234583185a12bc75e Mon Sep 17 00:00:00 2001 From: helge Date: Sun, 20 Feb 2005 20:44:18 +0000 Subject: [PATCH] improved product loader for MacOSX/FHS git-svn-id: http://svn.opengroupware.org/SOGo/trunk@590 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/Main/ChangeLog | 4 +++ SOGo/Main/SOGoProductLoader.m | 52 ++++++++++++++++++++++++++--------- SOGo/Main/Version | 2 +- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/SOGo/Main/ChangeLog b/SOGo/Main/ChangeLog index bb1d141a..3393adff 100644 --- a/SOGo/Main/ChangeLog +++ b/SOGo/Main/ChangeLog @@ -1,3 +1,7 @@ +2005-02-20 Helge Hess + + * SOGoProductLoader.m: fixed product loader for FHS and Cocoa (0.9.25) + 2005-02-17 Helge Hess * SOGo.m: added a proper application 'name' for the WEResourceManager, diff --git a/SOGo/Main/SOGoProductLoader.m b/SOGo/Main/SOGoProductLoader.m index bd115d32..875b93d9 100644 --- a/SOGo/Main/SOGoProductLoader.m +++ b/SOGo/Main/SOGoProductLoader.m @@ -53,18 +53,9 @@ /* loading */ -- (NSArray *)productSearchPathes { - NSMutableArray *ma; - NSDictionary *env; +- (void)_addCocoaSearchPathesToArray:(NSMutableArray *)ma { id tmp; - - if (self->searchPathes != nil) - return self->searchPathes; - - env = [[NSProcessInfo processInfo] environment]; - ma = [NSMutableArray arrayWithCapacity:6]; -#if COCOA_Foundation_LIBRARY tmp = NSSearchPathForDirectoriesInDomains(NSAllLibrariesDirectory, NSAllDomainsMask, YES); @@ -78,7 +69,13 @@ [ma addObject:tmp]; } } -#else +} + +- (void)_addGNUstepSearchPathesToArray:(NSMutableArray *)ma { + NSDictionary *env; + id tmp; + + env = [[NSProcessInfo processInfo] environment]; if ((tmp = [env objectForKey:@"GNUSTEP_PATHPREFIX_LIST"]) == nil) tmp = [env objectForKey:@"GNUSTEP_PATHLIST"]; @@ -97,10 +94,39 @@ else { NSLog(@"%s: empty library search path !", __PRETTY_FUNCTION__); } +} + +- (void)_addFHSPathesToArray:(NSMutableArray *)ma { + NSString *s; + + s = @"sogod-0.9"; + [ma addObject:[@"/usr/local/lib/" stringByAppendingString:s]]; + [ma addObject:[@"/usr/lib/" stringByAppendingString:s]]; +} + +- (NSArray *)productSearchPathes { + NSMutableArray *ma; + BOOL hasGNUstepEnv; + + if (self->searchPathes != nil) + return self->searchPathes; + + hasGNUstepEnv = [[[[NSProcessInfo processInfo] environment] + objectForKey:@"GNUSTEP_USER_ROOT"] length] > 0 ? YES : NO; + + ma = [NSMutableArray arrayWithCapacity:6]; + + if (hasGNUstepEnv) + [self _addGNUstepSearchPathesToArray:ma]; +#if COCOA_Foundation_LIBRARY + else + [self _addCocoaSearchPathesToArray:ma]; #endif - + + [self _addFHSPathesToArray:ma]; + self->searchPathes = [ma copy]; - + if ([self->searchPathes count] == 0) { [self logWithFormat:@"%s: no search pathes were found !", __PRETTY_FUNCTION__]; diff --git a/SOGo/Main/Version b/SOGo/Main/Version index 8a30220f..32f78759 100644 --- a/SOGo/Main/Version +++ b/SOGo/Main/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=24 +SUBMINOR_VERSION:=25 # v0.9.24 requires libWEExtensions v4.5.67 # v0.9.16 requires libNGExtensions v4.5.136 -- 2.39.5