mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOAccess/EOModel.m
add - _deleteTrashAtPath: avoid keeping unused files in the wrapper directory. basically, .svn/.cvs/.git as this does not change that often I am not moving this to an external plist at the moment. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30929 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
87005f5ae5
commit
7b64c1681a
2 changed files with 40 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
|||
2010-07-05 David Wetzel <dave@turbocat.de>
|
||||
* EOAccess/EOModel.m
|
||||
add - _deleteTrashAtPath:
|
||||
avoid keeping unused files in the wrapper directory.
|
||||
basically, .svn/.cvs/.git
|
||||
as this does not change that often I am not moving this to an
|
||||
external plist at the moment.
|
||||
|
||||
2010-07-05 David Wetzel <dave@turbocat.de>
|
||||
* EOAccess/EODatabaseContext.m
|
||||
valuesForKeys: -> dictionaryWithValuesForKeys:
|
||||
|
|
|
@ -569,6 +569,36 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
return ok;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes any non-known files/paths at path.
|
||||
* private.
|
||||
*/
|
||||
|
||||
- (void) _deleteTrashAtPath:(NSString*) path
|
||||
{
|
||||
NSFileManager * manager = [NSFileManager defaultManager];
|
||||
NSDirectoryEnumerator * dirEnumer = [manager enumeratorAtPath:path];
|
||||
|
||||
NSArray * knownTrashPaths = [NSArray arrayWithObjects:@".svn",
|
||||
@".cvs", @".git",
|
||||
nil];
|
||||
NSString * fileName = nil;
|
||||
|
||||
while ((fileName = [dirEnumer nextObject])) {
|
||||
NSString * prefix = [[fileName pathComponents] objectAtIndex:0];
|
||||
if (([knownTrashPaths containsObject:prefix] == NO)) {
|
||||
NSString * fullPath = nil;
|
||||
|
||||
fullPath = [path stringByAppendingPathComponent:fileName];
|
||||
if ([manager removeFileAtPath: fullPath handler: nil] == NO)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Could not remove %@", fullPath];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Writes the receivers plist representation into an
|
||||
* .eomodeld file wrapper located at path. </p>
|
||||
|
@ -664,6 +694,8 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
|
|||
}
|
||||
}
|
||||
|
||||
[self _deleteTrashAtPath:path];
|
||||
|
||||
entityEnum = [[pList objectForKey: @"entities"] objectEnumerator];
|
||||
while (writeSingleFile == NO
|
||||
&& (entityPList = [entityEnum nextObject]))
|
||||
|
|
Loading…
Reference in a new issue