mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Allow listing of tools
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10624 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d8ebb20e61
commit
31d2bf6598
4 changed files with 32 additions and 12 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
* Documentation/gsdoc/Base.gsdoc: Documented all the uses of
|
* Documentation/gsdoc/Base.gsdoc: Documented all the uses of
|
||||||
environment variables I could find.
|
environment variables I could find.
|
||||||
|
* Source/NSUserDefaults.m: __createArgumentDictionary ... handle
|
||||||
|
property lists as arguments correctly.
|
||||||
|
* Source/NSUser.m: Added GSTooldDirectory to listable paths.
|
||||||
|
|
||||||
2001-07-31 Richard Frith-Macdonald <rfm@gnu.org>
|
2001-07-31 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ typedef enum
|
||||||
NSAllApplicationsDirectory,
|
NSAllApplicationsDirectory,
|
||||||
NSAllLibrariesDirectory,
|
NSAllLibrariesDirectory,
|
||||||
GSLibrariesDirectory,
|
GSLibrariesDirectory,
|
||||||
|
GSToolsDirectory,
|
||||||
} NSSearchPathDirectory;
|
} NSSearchPathDirectory;
|
||||||
|
|
||||||
typedef unsigned int NSSearchPathDomainMask;
|
typedef unsigned int NSSearchPathDomainMask;
|
||||||
|
|
|
@ -512,6 +512,7 @@ NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directoryKey,
|
||||||
NSString *devDir = @"Developer";
|
NSString *devDir = @"Developer";
|
||||||
NSString *libraryDir = @"Library";
|
NSString *libraryDir = @"Library";
|
||||||
NSString *libsDir = @"Libraries";
|
NSString *libsDir = @"Libraries";
|
||||||
|
NSString *toolsDir = @"Tools";
|
||||||
NSString *docDir = @"Documentation";
|
NSString *docDir = @"Documentation";
|
||||||
NSMutableArray *paths = [NSMutableArray new];
|
NSMutableArray *paths = [NSMutableArray new];
|
||||||
NSString *path;
|
NSString *path;
|
||||||
|
@ -563,7 +564,7 @@ if (domainMask & mask) \
|
||||||
{
|
{
|
||||||
NSString *devAppsDir = [devDir stringByAppendingPathComponent: appsDir];
|
NSString *devAppsDir = [devDir stringByAppendingPathComponent: appsDir];
|
||||||
|
|
||||||
/* FIXME - why not NSUserDomainMask ? */
|
ADD_PATH (NSUserDomainMask, gnustep_local_root, devAppsDir);
|
||||||
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devAppsDir);
|
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devAppsDir);
|
||||||
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devAppsDir);
|
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devAppsDir);
|
||||||
ADD_PATH (NSSystemDomainMask, gnustep_system_root, devAppsDir);
|
ADD_PATH (NSSystemDomainMask, gnustep_system_root, devAppsDir);
|
||||||
|
@ -571,8 +572,8 @@ if (domainMask & mask) \
|
||||||
if (directoryKey == NSAdminApplicationDirectory
|
if (directoryKey == NSAdminApplicationDirectory
|
||||||
|| directoryKey == NSAllApplicationsDirectory)
|
|| directoryKey == NSAllApplicationsDirectory)
|
||||||
{
|
{
|
||||||
NSString *devAdminDir = [devDir stringByAppendingPathComponent:
|
NSString *devAdminDir = [devDir stringByAppendingPathComponent: adminDir];
|
||||||
adminDir];
|
|
||||||
/* FIXME - NSUserDomainMask ? - users have no Administrator directory */
|
/* FIXME - NSUserDomainMask ? - users have no Administrator directory */
|
||||||
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devAdminDir);
|
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devAdminDir);
|
||||||
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devAdminDir);
|
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devAdminDir);
|
||||||
|
@ -588,7 +589,7 @@ if (domainMask & mask) \
|
||||||
}
|
}
|
||||||
if (directoryKey == NSDeveloperDirectory)
|
if (directoryKey == NSDeveloperDirectory)
|
||||||
{
|
{
|
||||||
/* FIXME - why not NSUserDomainMask ? */
|
ADD_PATH (NSUserDomainMask, gnustep_local_root, devDir);
|
||||||
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devDir);
|
ADD_PATH (NSLocalDomainMask, gnustep_local_root, devDir);
|
||||||
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devDir);
|
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, devDir);
|
||||||
ADD_PATH (NSSystemDomainMask, gnustep_system_root, devDir);
|
ADD_PATH (NSSystemDomainMask, gnustep_system_root, devDir);
|
||||||
|
@ -616,6 +617,13 @@ if (domainMask & mask) \
|
||||||
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, libsDir);
|
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, libsDir);
|
||||||
ADD_PATH (NSSystemDomainMask, gnustep_system_root, libsDir);
|
ADD_PATH (NSSystemDomainMask, gnustep_system_root, libsDir);
|
||||||
}
|
}
|
||||||
|
if (directoryKey == GSToolsDirectory)
|
||||||
|
{
|
||||||
|
ADD_PATH (NSUserDomainMask, gnustep_user_root, toolsDir);
|
||||||
|
ADD_PATH (NSLocalDomainMask, gnustep_local_root, toolsDir);
|
||||||
|
ADD_PATH (NSNetworkDomainMask, gnustep_network_root, toolsDir);
|
||||||
|
ADD_PATH (NSSystemDomainMask, gnustep_system_root, toolsDir);
|
||||||
|
}
|
||||||
#undef ADD_PATH
|
#undef ADD_PATH
|
||||||
|
|
||||||
fm = [NSFileManager defaultManager];
|
fm = [NSFileManager defaultManager];
|
||||||
|
|
|
@ -1123,6 +1123,7 @@ static NSString *pathForUser(NSString *user)
|
||||||
if ([key hasPrefix: @"-"])
|
if ([key hasPrefix: @"-"])
|
||||||
{
|
{
|
||||||
NSString *old = nil;
|
NSString *old = nil;
|
||||||
|
|
||||||
/* anything beginning with a '-' is a defaults key and we must strip
|
/* anything beginning with a '-' is a defaults key and we must strip
|
||||||
the '-' from it. As a special case, we leave the '- in place
|
the '-' from it. As a special case, we leave the '- in place
|
||||||
for '-GS...' and '--GS...' for backward compatibility. */
|
for '-GS...' and '--GS...' for backward compatibility. */
|
||||||
|
@ -1132,27 +1133,34 @@ static NSString *pathForUser(NSString *user)
|
||||||
}
|
}
|
||||||
key = [key substringFromIndex: 1];
|
key = [key substringFromIndex: 1];
|
||||||
val = [enumerator nextObject];
|
val = [enumerator nextObject];
|
||||||
if (!val)
|
if (val == nil)
|
||||||
{ // No more args
|
{ // No more args
|
||||||
[argDict setObject: @"" forKey: key]; // arg is empty.
|
[argDict setObject: @"" forKey: key]; // arg is empty.
|
||||||
if (old)
|
if (old != nil)
|
||||||
[argDict setObject: @"" forKey: old];
|
{
|
||||||
|
[argDict setObject: @"" forKey: old];
|
||||||
|
}
|
||||||
done = YES;
|
done = YES;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if ([val hasPrefix: @"-"])
|
else if ([val hasPrefix: @"-"] == YES)
|
||||||
{ // Yet another argument
|
{ // Yet another argument
|
||||||
[argDict setObject: @"" forKey: key]; // arg is empty.
|
[argDict setObject: @"" forKey: key]; // arg is empty.
|
||||||
if (old)
|
if (old != nil)
|
||||||
[argDict setObject: @"" forKey: old];
|
{
|
||||||
|
[argDict setObject: @"" forKey: old];
|
||||||
|
}
|
||||||
key = val;
|
key = val;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Real parameter
|
{ // Real parameter
|
||||||
|
val = [val propertyList];
|
||||||
[argDict setObject: val forKey: key];
|
[argDict setObject: val forKey: key];
|
||||||
if (old)
|
if (old != nil)
|
||||||
[argDict setObject: val forKey: old];
|
{
|
||||||
|
[argDict setObject: val forKey: old];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
done = ((key = [enumerator nextObject]) == nil);
|
done = ((key = [enumerator nextObject]) == nil);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue