git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3308 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1998-11-23 21:40:54 +00:00
parent 407d404c80
commit 3c8c8be841

View file

@ -1,4 +1,7 @@
/* This tool builds a cache of service specifications
/* This tool builds a cache of service specifications like the
NeXTstep/ OPENSTEP 'make_services' tool. In addition it builds a list of
applications and services-bundles found in the standard directories.
Copyright (C) 1998 Free Software Foundation, Inc.
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
@ -43,6 +46,7 @@ static NSMutableDictionary *serviceMap;
static NSMutableDictionary *filterMap;
static NSMutableDictionary *printMap;
static NSMutableDictionary *spellMap;
static NSMutableDictionary *applicationMap;
int
main(int argc, char** argv)
@ -76,6 +80,7 @@ main(int argc, char** argv)
filterMap = [NSMutableDictionary dictionaryWithCapacity: 66];
printMap = [NSMutableDictionary dictionaryWithCapacity: 8];
spellMap = [NSMutableDictionary dictionaryWithCapacity: 8];
applicationMap = [NSMutableDictionary dictionaryWithCapacity: 64];
env = [proc environment];
args = [proc arguments];
@ -190,6 +195,7 @@ main(int argc, char** argv)
[fullMap setObject: filterMap forKey: @"ByFilter"];
[fullMap setObject: printMap forKey: @"ByPrint"];
[fullMap setObject: spellMap forKey: @"BySpell"];
[fullMap setObject: applicationMap forKey: @"Applications"];
str = [usrRoot stringByAppendingPathComponent: cacheName];
data = [NSSerializer serializePropertyList: fullMap];
@ -227,6 +233,17 @@ scanDirectory(NSMutableDictionary *services, NSString *path)
{
NSString *infPath;
/*
* All (non-debug) application paths are noted by name
* in the 'applicationMap' dictionary.
*/
if ([ext isEqualToString: @"app"])
{
if ([applicationMap objectForKey: name] == nil)
{
[applicationMap setObject: newPath forKey: name];
}
}
infPath = [newPath stringByAppendingPathComponent: infoLoc];
if ([mgr fileExistsAtPath: infPath isDirectory: &isDir] && !isDir)
{