[39374] branches/gsoc08-framework/MacPorts_Framework_Release

armahg at macports.org armahg at macports.org
Mon Aug 18 22:24:31 PDT 2008


Revision: 39374
          http://trac.macosforge.org/projects/macports/changeset/39374
Author:   armahg at macports.org
Date:     2008-08-18 22:24:31 -0700 (Mon, 18 Aug 2008)
Log Message:
-----------
Fixed port uninstall operation bug. Changed MPPort -uninstallWithOptions: version: error: method to -uninstallWithVersion: error:

Modified Paths:
--------------
    branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.h
    branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m
    branches/gsoc08-framework/MacPorts_Framework_Release/MPPortManipulationTest.m
    branches/gsoc08-framework/MacPorts_Framework_Release/interpInit.tcl

Modified: branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.h	2008-08-19 04:17:31 UTC (rev 39373)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.h	2008-08-19 05:24:31 UTC (rev 39374)
@@ -113,29 +113,26 @@
 
 /*!
  @brief Deactivates and uninstalls this MPPort from the MacPorts system
- @param options An NSArray of NSStrings of options for this uninstallation execution
  @param version An NSString indicating which version of this port to uninstall
  @discussion version should NOT be nil
  */
-- (void)uninstallWithOptions:(NSArray *)options version:(NSString *)version error:(NSError**)mpError;
+- (void)uninstallWithVersion:(NSString *)version error:(NSError**)mpError;
 /*!
  @brief Activates an installed MPPort.
- @param options An NSArray of NSStrings of options for port activation
  @param version An NSString indicating which version of this port to activate
  @discussion version should NOT be nil. The activated port should have been
  already installed. This happens automatically during a default installation
  of a port. This means activation of a port should occur only if the port
  had been previously deactivated after a default installation.
  */
-- (void)activateWithOptions:(NSArray *)options version:(NSString *)version error:(NSError**)mpError;
+- (void)activateWithVersion:(NSString *)version error:(NSError**)mpError;
 /*!
  @brief Deactivates an installed  MPPort.
- @param options An NSArray of NSStrings of options for port deactivation
  @param version An NSString indicating which version of this port to deactivate
  @discussion version should NOT be nil. Only installed and active ports
  should be deactivated
 */
-- (void)deactivateWithOptions:(NSArray *)options version:(NSString *)version error:(NSError**)mpError;
+- (void)deactivateWithVersion:(NSString *)version error:(NSError**)mpError;
 
 
 /*!

Modified: branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m	2008-08-19 04:17:31 UTC (rev 39373)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/MPPort.m	2008-08-19 05:24:31 UTC (rev 39374)
@@ -165,13 +165,14 @@
 	NSString *opts, *v;
 	MPInterpreter *interpreter;
 	opts = [NSString stringWithString:@" "];
-	v = [NSString stringWithString:[self name]];
+	//v = [NSString stringWithString:[self name]];
 	interpreter = [MPInterpreter sharedInterpreter];
 	
 	if (version != NULL)
 		v = [NSString stringWithString:version];
 	else 
-		v = [NSString stringWithString:[self version]];
+		v = @"";
+		//v = [NSString stringWithString:[self version]];
 	
 	if (options != NULL) 
 		opts = [NSString stringWithString:[options componentsJoinedByString:@" "]];	
@@ -183,7 +184,7 @@
 	
 	[interpreter evaluateStringWithPossiblePrivileges:
 	 [NSString stringWithFormat:
-	  @"[%@ %@ %@ %@]" ,
+	  @"%@ %@ %@ %@" ,
 	  procedure, [self name], v, opts]
 								  error:execError];
 	
@@ -261,16 +262,16 @@
 
 #pragma mark -
 # pragma mark Exec methods 
-- (void)uninstallWithOptions:(NSArray *)options version:(NSString *)version error:(NSError **)mError {
-	[self execPortProc:@"mportuninstall" withOptions:options version:version error:mError];
+- (void)uninstallWithVersion:(NSString *)version error:(NSError **)mError {
+	[self execPortProc:@"mportuninstall" withOptions:nil version:version error:mError];
 }
 
-- (void)activateWithOptions:(NSArray *)options version:(NSString *)version error:(NSError **)mError {
-	[self execPortProc:@"mportactivate" withOptions:options version:version error:mError];
+- (void)activateWithVersion:(NSString *)version error:(NSError **)mError {
+	[self execPortProc:@"mportactivate" withOptions:nil version:version error:mError];
 }
 
-- (void)deactivateWithOptions:(NSArray *)options version:(NSString *)version error:(NSError **)mError {
-	[self execPortProc:@"mportdeactivate" withOptions:options version:version error:mError];
+- (void)deactivateWithVersion:(NSString *)version error:(NSError **)mError {
+	[self execPortProc:@"mportdeactivate" withOptions:nil version:version error:mError];
 }
 
 -(void)configureWithOptions:(NSArray *)options variants:(NSArray *)variants error:(NSError **)mError {

Modified: branches/gsoc08-framework/MacPorts_Framework_Release/MPPortManipulationTest.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/MPPortManipulationTest.m	2008-08-19 04:17:31 UTC (rev 39373)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/MPPortManipulationTest.m	2008-08-19 05:24:31 UTC (rev 39374)
@@ -33,7 +33,7 @@
 	if (installed > 0) {
 		NSError * uError;
 		//Attempt to uninstall it
-		[foundPort uninstallWithOptions:nil version:nil error:&uError];
+		[foundPort uninstallWithVersion:nil error:&uError];
 		
 		//Check for error
 		if (uError != nil) {

Modified: branches/gsoc08-framework/MacPorts_Framework_Release/interpInit.tcl
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework_Release/interpInit.tcl	2008-08-19 04:17:31 UTC (rev 39373)
+++ branches/gsoc08-framework/MacPorts_Framework_Release/interpInit.tcl	2008-08-19 05:24:31 UTC (rev 39374)
@@ -152,9 +152,10 @@
 
 #Wrapping the following API routines to catch errors
 #and log error Information in a similar fashion to code
-#in macports.tcl.
-proc mportuninstall {portname {v ""} optionslist} {
-	if {[catch {portuninstall::uninstall $portname $v $optionslist} result]} {
+#in macports.tcl. Note optionslist is not being used for now
+set mp_empty_list [list]
+proc mportuninstall {portname {v ""} {optionslist ""} } {
+	if {[catch {portuninstall::uninstall $portname $v [array get options]} result]} {
 		
 			global errorInfo
 			ui_debug "$errorInfo"
@@ -163,7 +164,7 @@
 	}
 }
 
-proc mportactivate {portname v optionslist} {
+proc mportactivate {portname {v ""} {optionslist ""}} {
 	if {[catch {portimage::activate $portname $v $optionslist} result]} {
 			
 			global errorInfo
@@ -173,7 +174,7 @@
 	}
 }
 
-proc mportdeactivate {portname v optionslist} {
+proc mportdeactivate {portname {v ""} {optionslist ""} } {
 	if {[catch {portimage::deactivate $portname $v $optionslist} result]} {
 			
 			global errorInfo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080818/d98cddb9/attachment.html 


More information about the macports-changes mailing list