leaned up the writeMakefile method

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@11909 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2001-12-29 14:07:39 +00:00
parent cdcc6ced81
commit c574c7cae4

View file

@ -87,26 +87,19 @@
- (BOOL)writeMakefile
{
NSFileManager *fm = [NSFileManager defaultManager];
NSString *makefile = [[self projectPath] stringByAppendingPathComponent:@"GNUmakefile"];
NSData *content;
NSData *mfd;
NSString *mf = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
if (![super writeMakefile]) {
NSLog(@"Couldn't update PC.project...");
}
// Save the project file
[super writeMakefile];
if (mfd = [[PCLibMakefileFactory sharedFactory] makefileForProject:self]) {
if ([mfd writeToFile:mf atomically:YES]) {
return YES;
}
}
if (![fm movePath:makefile toPath:[projectPath stringByAppendingPathComponent:@"GNUmakefile~"] handler:nil]) {
NSLog(@"Couldn't write a backup GNUmakefile...");
}
if (!(content = [[PCLibMakefileFactory sharedFactory] makefileForProject:self])) {
NSLog([NSString stringWithFormat:@"Couldn't build the GNUmakefile %@!",makefile]);
return NO;
}
if (![content writeToFile:makefile atomically:YES]) {
NSLog([NSString stringWithFormat:@"Couldn't write the GNUmakefile %@!",makefile]);
return NO;
}
return YES;
return NO;
}
- (BOOL)isValidDictionary:(NSDictionary *)aDict