mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:00:48 +00:00
Use GNUSTEP_PATHPREFIX_LIST if available
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4334 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cc41617807
commit
2b27a6f620
2 changed files with 60 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Jun 2 8:34:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
|
* Tools/make_services.m: Updated to use the GNUSTEP_PATHPREFIX_LIST
|
||||||
|
environment variable if it is available.
|
||||||
|
|
||||||
Wed Jun 2 4:10:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
Wed Jun 2 4:10:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
Added patches from jagapen@whitewater.chem.wisc.edu -
|
Added patches from jagapen@whitewater.chem.wisc.edu -
|
||||||
|
|
|
@ -69,6 +69,7 @@ main(int argc, char** argv)
|
||||||
NSString *str;
|
NSString *str;
|
||||||
unsigned index;
|
unsigned index;
|
||||||
BOOL isDir;
|
BOOL isDir;
|
||||||
|
BOOL usedPrefixes = NO;
|
||||||
NSMutableDictionary *fullMap;
|
NSMutableDictionary *fullMap;
|
||||||
NSDictionary *oldMap;
|
NSDictionary *oldMap;
|
||||||
|
|
||||||
|
@ -145,6 +146,32 @@ main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
roots = [NSMutableArray arrayWithCapacity: 3];
|
roots = [NSMutableArray arrayWithCapacity: 3];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set up an array of root paths from the prefix list if possible.
|
||||||
|
* If we managed to get any paths, we set a flag so we know not to
|
||||||
|
* get and add default values later.
|
||||||
|
*/
|
||||||
|
str = [env objectForKey: @"GNUSTEP_PATHPREFIX_LIST"];
|
||||||
|
if (str != nil && [str isEqualToString: @""] == NO)
|
||||||
|
{
|
||||||
|
NSArray *a = [str componentsSeparatedByString: @":"];
|
||||||
|
unsigned index;
|
||||||
|
|
||||||
|
for (index = 0; index < [a count]; index++)
|
||||||
|
{
|
||||||
|
str = [a objectAtIndex: index];
|
||||||
|
if ([str isEqualToString: @""] == NO)
|
||||||
|
{
|
||||||
|
if ([roots containsObject: str] == NO)
|
||||||
|
{
|
||||||
|
[roots addObject: str];
|
||||||
|
usedPrefixes = YES;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
services = [NSMutableDictionary dictionaryWithCapacity: 200];
|
services = [NSMutableDictionary dictionaryWithCapacity: 200];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -169,9 +196,10 @@ main(int argc, char** argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[roots addObject: usrRoot];
|
|
||||||
|
|
||||||
usrRoot = [usrRoot stringByAppendingPathComponent: @"Services"];
|
str = usrRoot; /* Record for adding into roots array */
|
||||||
|
|
||||||
|
usrRoot = [str stringByAppendingPathComponent: @"Services"];
|
||||||
if (([mgr fileExistsAtPath: usrRoot isDirectory: &isDir] && isDir) == 0)
|
if (([mgr fileExistsAtPath: usrRoot isDirectory: &isDir] && isDir) == 0)
|
||||||
{
|
{
|
||||||
if ([mgr createDirectoryAtPath: usrRoot attributes: nil] == NO)
|
if ([mgr createDirectoryAtPath: usrRoot attributes: nil] == NO)
|
||||||
|
@ -182,17 +210,32 @@ main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
str = [env objectForKey: @"GNUSTEP_LOCAL_ROOT"];
|
if (usedPrefixes == NO)
|
||||||
if (str != nil)
|
{
|
||||||
[roots addObject: str];
|
/*
|
||||||
else
|
* Ensure that the user root (or default user root) is in the path.
|
||||||
[roots addObject: @"/usr/GNUstep/Local"];
|
*/
|
||||||
|
if ([roots containsObject: str] == NO)
|
||||||
|
[roots addObject: str];
|
||||||
|
|
||||||
str = [env objectForKey: @"GNUSTEP_SYSTEM_ROOT"];
|
/*
|
||||||
if (str != nil)
|
* Ensure that the local root (or default local root) is in the path.
|
||||||
[roots addObject: str];
|
*/
|
||||||
else
|
str = [env objectForKey: @"GNUSTEP_LOCAL_ROOT"];
|
||||||
[roots addObject: @"/usr/GNUstep"];
|
if (str == nil)
|
||||||
|
str = @"/usr/GNUstep/Local";
|
||||||
|
if ([roots containsObject: str] == NO)
|
||||||
|
[roots addObject: str];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ensure that the system root (or default system root) is in the path.
|
||||||
|
*/
|
||||||
|
str = [env objectForKey: @"GNUSTEP_SYSTEM_ROOT"];
|
||||||
|
if (str == nil)
|
||||||
|
str = @"/usr/GNUstep";
|
||||||
|
if ([roots containsObject: str] == NO)
|
||||||
|
[roots addObject: str];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Before doing the main scan, we examine the 'Services' directory to
|
* Before doing the main scan, we examine the 'Services' directory to
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue