[52785] branches/gsoc09-gui/MacPorts_Framework

juanger at macports.org juanger at macports.org
Mon Jun 22 21:07:18 PDT 2009


Revision: 52785
          http://trac.macports.org/changeset/52785
Author:   juanger at macports.org
Date:     2009-06-22 21:07:17 -0700 (Mon, 22 Jun 2009)
Log Message:
-----------
New mpportupgrade command implementation

Modified Paths:
--------------
    branches/gsoc09-gui/MacPorts_Framework/MPPort.h
    branches/gsoc09-gui/MacPorts_Framework/MPPort.m
    branches/gsoc09-gui/MacPorts_Framework/MPPortManipulationTest.m
    branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
    branches/gsoc09-gui/MacPorts_Framework/init.tcl
    branches/gsoc09-gui/MacPorts_Framework/interpInit.tcl

Modified: branches/gsoc09-gui/MacPorts_Framework/MPPort.h
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPPort.h	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/MPPort.h	2009-06-23 04:07:17 UTC (rev 52785)
@@ -140,7 +140,14 @@
 */
 - (void)deactivateWithVersion:(NSString *)version error:(NSError**)mpError;
 
+/*!
+ @brief Upgrades an outdated MPPort.
+ @discussion Only installed and active ports
+ should be upgraded
+ */
+- (void)upgradeWithError:(NSError**)mpError;
 
+
 /*!
  @brief Executes the specified target for this MPPort
  @param target NSString target to be executed for this MPPort
@@ -290,4 +297,5 @@
 - (void)execPortProc:(NSString *)procedure withOptions:(NSArray *)options version:(NSString *)version error:(NSError **)execError;
 //Even more generic method to execute a Tcl command with any given number of args
 - (void)execPortProc:(NSString *)procedure withParams:(NSArray *)params error:(NSError **)execError;
- at end
+
+ at end
\ No newline at end of file

Modified: branches/gsoc09-gui/MacPorts_Framework/MPPort.m
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPPort.m	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/MPPort.m	2009-06-23 04:07:17 UTC (rev 52785)
@@ -350,6 +350,10 @@
 	}
 }
 
+- (void)upgradeWithError:(NSError **)mError {
+	[self execPortProc:@"mportupgrade" withOptions:nil version:@"" error:mError];
+}
+
 -(void)configureWithOptions:(NSArray *)options variants:(NSArray *)variants error:(NSError **)mError {
 	[self exec:@"configure" withOptions:options variants:variants error:mError];
 }
@@ -402,6 +406,7 @@
 	[self exec:@"srpm" withOptions:options variants:variants error:mError];
 }
 
+
 # pragma mark -
 
 

Modified: branches/gsoc09-gui/MacPorts_Framework/MPPortManipulationTest.m
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPPortManipulationTest.m	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/MPPortManipulationTest.m	2009-06-23 04:07:17 UTC (rev 52785)
@@ -18,7 +18,7 @@
 -(BOOL) installUninstallManipulation:(NSString *)portName {
 	BOOL ret = NO;
 	
-	MPMacPorts * port = [MPMacPorts sharedInstanceWithPkgPath:@"/Users/juanger/local/macportsbuild/branch-unprivileged/Library/Tcl"
+	MPMacPorts * port = [MPMacPorts sharedInstanceWithPkgPath:@"/Users/juanger/Projects/gsoc09-gui/MPGUI/build/Debug-InstallMacPorts/macports-1.8/Library/Tcl"
 	 					portOptions:nil];
 	NSLog(@"PkgPath1:  %@", [MPInterpreter PKGPath]);
 	MPRegistry * registry = [MPRegistry sharedRegistry];
@@ -123,7 +123,7 @@
 //		NSLog(@"\n\n Installation successful \n\n");
 //		
 //		
-//	}
+//	}	
 //	
 //	//Double check somehow
 //	MPRegistry * registry = [MPRegistry sharedRegistry];
@@ -132,6 +132,7 @@
 	PortManipulator * pm = [[PortManipulator alloc] init];
 	STAssertTrue([pm installUninstallManipulation:@"pngcrush"] , @"This test should always return true on success");
 	[pm release];
+    
 }
 
 @end

Modified: branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2009-06-23 04:07:17 UTC (rev 52785)
@@ -138,7 +138,7 @@
 		48E992970C82C98C00219DDF /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = /System/Library/Frameworks/Tcl.framework; sourceTree = "<absolute>"; };
 		48E993920C82CAAE00219DDF /* MPMacPorts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMacPorts.h; sourceTree = "<group>"; };
 		48E993930C82CAAE00219DDF /* MPMacPorts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPMacPorts.m; sourceTree = "<group>"; };
-		48E9939E0C82CEB000219DDF /* init.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = init.tcl; sourceTree = "<group>"; };
+		48E9939E0C82CEB000219DDF /* init.tcl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = init.tcl; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.simpleColoring; };
 		48F811BE0CE4636A009630DE /* MPRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPRegistry.h; sourceTree = "<group>"; };
 		48F811BF0CE4638C009630DE /* MPRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPRegistry.m; sourceTree = "<group>"; };
 		6E270D070E158CED00BAE687 /* MPNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNotifications.h; sourceTree = "<group>"; };
@@ -761,7 +761,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = MacPorts.Framework_Prefix.pch;
 				INFOPLIST_FILE = Info.plist;
-				INSTALL_PATH = "$(HOME)/Library/Frameworks";
+				INSTALL_PATH = "@executable_path/../Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",

Modified: branches/gsoc09-gui/MacPorts_Framework/init.tcl
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/init.tcl	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/init.tcl	2009-06-23 04:07:17 UTC (rev 52785)
@@ -190,9 +190,15 @@
 	}
 }
 
-proc mportupgrade {args} \
-{
-	
+proc mportupgrade {portname} {
+    array set depscache {}
+	if {[catch {macports::upgrade $portname "port:$portname" [array get global_variations] [array get variations] [array get options] depscache} result]} {
+			
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Upgrade $portname failed: $result"
+			return 1
+	}
 }
 
 
@@ -203,4 +209,4 @@
 	global errorInfo
 	puts "$errorInfo"
 	fatal "Failed to initialize ports system, $result"
-}
\ No newline at end of file
+}

Modified: branches/gsoc09-gui/MacPorts_Framework/interpInit.tcl
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/interpInit.tcl	2009-06-23 03:53:57 UTC (rev 52784)
+++ branches/gsoc09-gui/MacPorts_Framework/interpInit.tcl	2009-06-23 04:07:17 UTC (rev 52785)
@@ -193,8 +193,17 @@
 	}
 }
 
+proc mportupgrade {portname} {
+    array set depscache {}
+	if {[catch {macports::upgrade $portname "port:$portname" [array get global_variations] [array get variations] [array get options] depscache} result]} {
+			
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Upgrade $portname failed: $result"
+			return 1
+	}
+}
 
-
 # Initialize dport
 # This must be done following parse of global options, as some options are
 # evaluated by dportinit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090622/e5ff189f/attachment-0001.html>


More information about the macports-changes mailing list