[39280] branches/gsoc08-framework/MacPorts_Framework_Release
armahg at macports.org
armahg at macports.org
Fri Aug 15 08:43:20 PDT 2008
Revision: 39280
http://trac.macosforge.org/projects/macports/changeset/39280
Author: armahg at macports.org
Date: 2008-08-15 08:43:19 -0700 (Fri, 15 Aug 2008)
Log Message:
-----------
Modified -sync , -selfUpdate and exec methods to use -evaluateStringWithPossiblePrivileges: error: method
Modified Paths:
--------------
branches/gsoc08-framework/MacPorts_Framework_Release/MPMacPorts.m
branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m
Modified: branches/gsoc08-framework/MacPorts_Framework_Release/MPMacPorts.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/MPMacPorts.m 2008-08-15 15:16:20 UTC (rev 39279)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/MPMacPorts.m 2008-08-15 15:43:19 UTC (rev 39280)
@@ -110,7 +110,7 @@
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_sync_Started" object:nil];
[[MPNotifications sharedListener] setPerformingTclCommand:@"YES_sync"];
- result = [interpreter evaluateStringAsString:@"mportsync" error:sError];
+ result = [interpreter evaluateStringWithPossiblePrivileges:@"mportsync" error:sError];
[[MPNotifications sharedListener] setPerformingTclCommand:@""];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_sync_Finished" object:nil];
@@ -123,7 +123,7 @@
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_selfupdate_Started" object:nil];
[[MPNotifications sharedListener] setPerformingTclCommand:@"YES_selfUpdate"];
- [interpreter evaluateStringAsString:@"macports::selfupdate" error:sError];
+ [interpreter evaluateStringWithPossiblePrivileges:@"macports::selfupdate" error:sError];
[[MPNotifications sharedListener] setPerformingTclCommand:@""];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"MacPorts_selfupdate_Finished" object:nil];
Modified: branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m 2008-08-15 15:16:20 UTC (rev 39279)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m 2008-08-15 15:43:19 UTC (rev 39280)
@@ -156,37 +156,6 @@
-//This method is nice but really isn't used.
-- (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params error:(NSError **)execError {
-
- //params can contain either NSStrings or NSArrays
- NSString * sparams = [NSString stringWithString:@" "];
- NSEnumerator * penums = [params objectEnumerator];
- MPInterpreter *interpreter = [MPInterpreter sharedInterpreter];
-
- id elem;
-
- while (elem = [penums nextObject]) {
- if ([elem isMemberOfClass:[NSString class]]) {
- sparams = [sparams stringByAppendingString:elem];
- sparams = [sparams stringByAppendingString:@" "];
- }
-
- else if ([elem isKindOfClass:[NSArray class]]) {
- //Maybe I should be more careful in the above if statement and
- //explicitly check for the classes i'm interested in?
- sparams = [sparams stringByAppendingString:[elem componentsJoinedByString:@" "]];
- sparams = [sparams stringByAppendingString:@" "];
- }
- }
-
-
- [interpreter evaluateStringAsString:[NSString stringWithFormat:@"[%@ %@]" , procedure, sparams]
- error:execError];
-
-}
-
-
//Used for mportactivate, mportdeactivate and mportuninstall
-(void)execPortProc:(NSString *)procedure
withOptions:(NSArray *)options
@@ -212,7 +181,7 @@
NSString * tclCmd = [@"YES_" stringByAppendingString:procedure];
[[MPNotifications sharedListener] setPerformingTclCommand:tclCmd];
- [interpreter evaluateStringAsString:
+ [interpreter evaluateStringWithPossiblePrivileges:
[NSString stringWithFormat:
@"[%@ %@ %@ %@]" ,
procedure, [self name], v, opts]
@@ -247,7 +216,7 @@
NSString * tclCmd = [@"YES_" stringByAppendingString:target];
[[MPNotifications sharedListener] setPerformingTclCommand:tclCmd];
- [interpreter evaluateStringAsString:
+ [interpreter evaluateStringWithPossiblePrivileges:
[NSString stringWithFormat:
@"set portHandle [mportopen %@ %@ %@]; \
mportexec portHandle %@; \
@@ -261,6 +230,35 @@
}
+//This method is nice but really isn't used.
+- (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params error:(NSError **)execError {
+
+ //params can contain either NSStrings or NSArrays
+ NSString * sparams = [NSString stringWithString:@" "];
+ NSEnumerator * penums = [params objectEnumerator];
+ MPInterpreter *interpreter = [MPInterpreter sharedInterpreter];
+
+ id elem;
+
+ while (elem = [penums nextObject]) {
+ if ([elem isMemberOfClass:[NSString class]]) {
+ sparams = [sparams stringByAppendingString:elem];
+ sparams = [sparams stringByAppendingString:@" "];
+ }
+
+ else if ([elem isKindOfClass:[NSArray class]]) {
+ //Maybe I should be more careful in the above if statement and
+ //explicitly check for the classes i'm interested in?
+ sparams = [sparams stringByAppendingString:[elem componentsJoinedByString:@" "]];
+ sparams = [sparams stringByAppendingString:@" "];
+ }
+ }
+
+
+ [interpreter evaluateStringAsString:[NSString stringWithFormat:@"[%@ %@]" , procedure, sparams]
+ error:execError];
+
+}
#pragma mark -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080815/1c2ccddb/attachment.html
More information about the macports-changes
mailing list