mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
NSSearchPathForDirectoriesInDomains() changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8847 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9344a6c2d8
commit
403aba0f59
3 changed files with 79 additions and 15 deletions
|
@ -1,3 +1,11 @@
|
|||
2001-01-28 Jonathan Gapen <jagapen@home.com>
|
||||
|
||||
* Source/NSUser.m: In NSSearchPathForDirectoriesInDomains(), added
|
||||
support for NSDeveloperDirectory, NSAdminDirectory, and the new
|
||||
GSLibrariesDirectory.
|
||||
* Headers/gnustep/base/NSPathUtilities.h: Added new enum value
|
||||
GSLibrariesDirectory, to support GNUstep's Libraries dir.
|
||||
|
||||
2001-01-26 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* gnustep-base.script.spec.in: New file, rpm script for installing
|
||||
|
|
|
@ -55,7 +55,8 @@ typedef enum
|
|||
NSUserDirectory,
|
||||
NSDocumentationDirectory,
|
||||
NSAllApplicationsDirectory,
|
||||
NSAllLibrariesDirectory
|
||||
NSAllLibrariesDirectory,
|
||||
GSLibrariesDirectory,
|
||||
} NSSearchPathDirectory;
|
||||
|
||||
typedef unsigned int NSSearchPathDomainMask;
|
||||
|
|
|
@ -186,7 +186,7 @@ GSStandardPathPrefixes(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
NSString *strings[3];
|
||||
NSString *strings[4];
|
||||
NSString *str;
|
||||
unsigned count = 0;
|
||||
|
||||
|
@ -198,6 +198,10 @@ GSStandardPathPrefixes(void)
|
|||
if (str != nil)
|
||||
strings[count++] = str;
|
||||
|
||||
str = [env objectForKey: @"GNUSTEP_NETWORK_ROOT"];
|
||||
if (str != nil)
|
||||
strings[count++] = str;
|
||||
|
||||
str = [env objectForKey: @"GNUSTEP_SYSTEM_ROOT"];
|
||||
if (str != nil)
|
||||
strings[count++] = str;
|
||||
|
@ -309,8 +313,11 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
|
|||
NSString *gnustep_local_root;
|
||||
NSString *gnustep_network_root;
|
||||
NSString *gnustep_system_root;
|
||||
NSString *adminDir = @"Administrator";
|
||||
NSString *appsDir = @"Apps";
|
||||
NSString *devDir = @"Developer";
|
||||
NSString *libraryDir = @"Library";
|
||||
NSString *libsDir = @"Libraries";
|
||||
NSString *docDir = @"Documentation";
|
||||
NSMutableArray *paths = [NSMutableArray new];
|
||||
NSString *path;
|
||||
|
@ -342,11 +349,42 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
|
|||
/*
|
||||
if (directoryKey == NSDemoApplicationDirectory
|
||||
|| directoryKey == NSAllApplicationsDirectory);
|
||||
if (directoryKey == NSDeveloperApplicationDirectory
|
||||
|| directoryKey == NSAllApplicationsDirectory);
|
||||
if (directoryKey == NSAdminApplicationDirectory
|
||||
|| directoryKey == NSAllApplicationsDirectory);
|
||||
*/
|
||||
if (directoryKey == NSDeveloperApplicationDirectory
|
||||
|| directoryKey == NSAllApplicationsDirectory)
|
||||
{
|
||||
if (domainMask & NSUserDomainMask);
|
||||
if (domainMask & NSLocalDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_local_root,
|
||||
devDir, appsDir, nil]]];
|
||||
if (domainMask & NSNetworkDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_network_root,
|
||||
devDir, appsDir, nil]]];
|
||||
if (domainMask & NSSystemDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_system_root,
|
||||
devDir, appsDir, nil]]];
|
||||
}
|
||||
if (directoryKey == NSAdminApplicationDirectory
|
||||
|| directoryKey == NSAllApplicationsDirectory)
|
||||
{
|
||||
if (domainMask & NSUserDomainMask);
|
||||
/* users have no Administrator directory */
|
||||
if (domainMask & NSLocalDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_local_root,
|
||||
devDir, adminDir, nil]]];
|
||||
if (domainMask & NSNetworkDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_network_root,
|
||||
devDir, adminDir, nil]]];
|
||||
if (domainMask & NSSystemDomainMask)
|
||||
[paths addObject: [NSString pathWithComponents:
|
||||
[NSArray arrayWithObjects: gnustep_system_root,
|
||||
devDir, adminDir, nil]]];
|
||||
}
|
||||
if (directoryKey == NSLibraryDirectory
|
||||
|| directoryKey == NSAllLibrariesDirectory)
|
||||
{
|
||||
|
@ -363,23 +401,25 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
|
|||
[paths addObject:
|
||||
[gnustep_system_root stringByAppendingPathComponent: libraryDir]];
|
||||
}
|
||||
if (directoryKey == NSDeveloperDirectory
|
||||
|| directoryKey == NSAllLibrariesDirectory)
|
||||
if (directoryKey == NSDeveloperDirectory)
|
||||
{
|
||||
// GNUstep doesn't have a 'Developer' subdirectory (yet?)
|
||||
if (domainMask & NSUserDomainMask)
|
||||
[paths addObject: gnustep_user_root];
|
||||
if (domainMask & NSUserDomainMask);
|
||||
/* users have no Developer directory */
|
||||
if (domainMask & NSLocalDomainMask)
|
||||
[paths addObject: gnustep_local_root];
|
||||
[paths addObject:
|
||||
[gnustep_local_root stringByAppendingPathComponent: devDir]];
|
||||
if (domainMask & NSNetworkDomainMask)
|
||||
[paths addObject: gnustep_network_root];
|
||||
[paths addObject:
|
||||
[gnustep_network_root stringByAppendingPathComponent: devDir]];
|
||||
if (domainMask & NSSystemDomainMask)
|
||||
[paths addObject: gnustep_system_root];
|
||||
[paths addObject:
|
||||
[gnustep_system_root stringByAppendingPathComponent: devDir]];
|
||||
}
|
||||
if (directoryKey == NSUserDirectory)
|
||||
{
|
||||
if (domainMask & NSUserDomainMask)
|
||||
[paths addObject: NSHomeDirectory()];
|
||||
[paths addObject: [NSHomeDirectory()
|
||||
stringByAppendingPathComponent: @"GNUstep"]];
|
||||
}
|
||||
if (directoryKey == NSDocumentationDirectory)
|
||||
{
|
||||
|
@ -396,6 +436,21 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
|
|||
[paths addObject:
|
||||
[gnustep_system_root stringByAppendingPathComponent: docDir]];
|
||||
}
|
||||
if (directoryKey == GSLibrariesDirectory)
|
||||
{
|
||||
if (domainMask & NSUserDomainMask)
|
||||
[paths addObject:
|
||||
[gnustep_user_root stringByAppendingPathComponent: libsDir]];
|
||||
if (domainMask & NSLocalDomainMask)
|
||||
[paths addObject:
|
||||
[gnustep_local_root stringByAppendingPathComponent: libsDir]];
|
||||
if (domainMask & NSNetworkDomainMask)
|
||||
[paths addObject:
|
||||
[gnustep_network_root stringByAppendingPathComponent: libsDir]];
|
||||
if (domainMask & NSSystemDomainMask)
|
||||
[paths addObject:
|
||||
[gnustep_system_root stringByAppendingPathComponent: libsDir]];
|
||||
}
|
||||
|
||||
fm = [NSFileManager defaultManager];
|
||||
for (i = 0; i < [paths count]; i++)
|
||||
|
|
Loading…
Reference in a new issue