mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix error copying directories.
Fix bundle for base library. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22621 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e1daaff84
commit
48d81791bc
3 changed files with 16 additions and 9 deletions
|
@ -6,7 +6,8 @@
|
|||
than cStringUsingEncoding:
|
||||
* Source/NSCalendarDate.m: Support '%T' and '%t' in description.
|
||||
* Source/NSFileManager.m: don't abort directory copy just because
|
||||
we can't set attributes of destination directory.
|
||||
we can't set attributes of destination directory. Don't try to
|
||||
copy directories with their old owners.
|
||||
* Source/NSSocketPortNameServer.m:
|
||||
* Source/NSBundle.m:
|
||||
* Source/NSProcessInfo.m:
|
||||
|
|
|
@ -712,8 +712,6 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
|||
env = [[NSProcessInfo processInfo] environment];
|
||||
if (env)
|
||||
{
|
||||
NSArray *paths;
|
||||
NSMutableString *system = nil;
|
||||
NSString *str;
|
||||
|
||||
if ((str = [env objectForKey: @"GNUSTEP_TARGET_CPU"]) != nil)
|
||||
|
@ -734,15 +732,10 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
|||
if ((str = [env objectForKey: @"LIBRARY_COMBO"]) != nil)
|
||||
library_combo = RETAIN(str);
|
||||
|
||||
paths = NSSearchPathForDirectoriesInDomains(GSLibrariesDirectory,
|
||||
NSSystemDomainMask, YES);
|
||||
if ((paths != nil) && ([paths count] > 0))
|
||||
system = RETAIN([paths objectAtIndex: 0]);
|
||||
|
||||
_launchDirectory = RETAIN([[NSFileManager defaultManager]
|
||||
currentDirectoryPath]);
|
||||
|
||||
_gnustep_bundle = RETAIN([self bundleWithPath: system]);
|
||||
_gnustep_bundle = RETAIN([self bundleForLibrary: @"gnustep-base"]);
|
||||
|
||||
#if 0
|
||||
_loadingBundle = [self mainBundle];
|
||||
|
|
|
@ -950,6 +950,8 @@ static NSStringEncoding defaultEncoding;
|
|||
fileType = [attrs fileType];
|
||||
if ([fileType isEqualToString: NSFileTypeDirectory] == YES)
|
||||
{
|
||||
NSMutableDictionary *mattrs;
|
||||
|
||||
/* If destination directory is a descendant of source directory copying
|
||||
isn't possible. */
|
||||
if ([[destination stringByAppendingString: @"/"]
|
||||
|
@ -960,6 +962,17 @@ static NSStringEncoding defaultEncoding;
|
|||
|
||||
[self _sendToHandler: handler willProcessPath: destination];
|
||||
|
||||
/*
|
||||
* Don't attempt to retain ownership of copy ... we want the copy
|
||||
* to be owned by the current user.
|
||||
*/
|
||||
mattrs = [attrs mutableCopy];
|
||||
[mattrs removeObjectForKey: NSFileOwnerAccountID];
|
||||
[mattrs removeObjectForKey: NSFileGroupOwnerAccountID];
|
||||
[mattrs removeObjectForKey: NSFileGroupOwnerAccountName];
|
||||
[mattrs setObject: NSUserName() forKey: NSFileOwnerAccountName];
|
||||
attrs = AUTORELEASE(mattrs);
|
||||
|
||||
if ([self createDirectoryAtPath: destination attributes: attrs] == NO)
|
||||
{
|
||||
return [self _proceedAccordingToHandler: handler
|
||||
|
|
Loading…
Reference in a new issue