[53717] branches/gsoc09-gui
juanger at macports.org
juanger at macports.org
Sun Jul 12 13:41:59 PDT 2009
Revision: 53717
http://trac.macports.org/changeset/53717
Author: juanger at macports.org
Date: 2009-07-12 13:41:59 -0700 (Sun, 12 Jul 2009)
Log Message:
-----------
Integrating MPPortProcess to the framework
Modified Paths:
--------------
branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj
branches/gsoc09-gui/MacPorts_Framework/MPInterpreter.m
branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.h
branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.m
branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
Modified: branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj 2009-07-12 20:39:39 UTC (rev 53716)
+++ branches/gsoc09-gui/MPGUI/MPGUI.xcodeproj/project.pbxproj 2009-07-12 20:41:59 UTC (rev 53717)
@@ -65,7 +65,7 @@
isa = PBXContainerItemProxy;
containerPortal = 21F165400FE2C04300542AEE /* MacPorts.Framework.xcodeproj */;
proxyType = 2;
- remoteGlobalIDString = 21D9543E100940EE00DEF58A /* MPPortProcess */;
+ remoteGlobalIDString = 21D9543E100940EE00DEF58A;
remoteInfo = MPPortProcess;
};
21F1654C0FE2C04300542AEE /* PBXContainerItemProxy */ = {
Modified: branches/gsoc09-gui/MacPorts_Framework/MPInterpreter.m
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPInterpreter.m 2009-07-12 20:39:39 UTC (rev 53716)
+++ branches/gsoc09-gui/MacPorts_Framework/MPInterpreter.m 2009-07-12 20:41:59 UTC (rev 53717)
@@ -657,9 +657,26 @@
}
- (NSString *) evaluateStringWithMPPortProcess:(NSString *) statement error:(NSError **)mportError {
- NSLog(@"Path: %@", [[NSBundle bundleForClass:[self class]] resourcePath]);
+/* NSString *portProcessInitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"portProcessInit" ofType:@"tcl"];
NSString *portProcessPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"MPPortProcess" ofType:@""];
- NSTask *portProcess = [NSTask launchedTaskWithLaunchPath:portProcessPath arguments:[NSArray arrayWithObject:PKGPath]];
+ NSLog(portProcessInitPath);
+
+ NSArray *args = [NSArray arrayWithObjects:PKGPath,portProcessInitPath];
+
+ NSTask *portProcess = [NSTask launchedTaskWithLaunchPath:[portProcessPath retain] arguments:[args retain]];
+ */
+ NSTask *aTask = [[NSTask alloc] init];
+ NSMutableArray *args = [NSMutableArray array];
+
+ /* set arguments */
+ [args addObject:PKGPath];
+ [aTask setCurrentDirectoryPath:[[NSBundle bundleForClass:[self class]] resourcePath]];
+ [aTask setLaunchPath:[[NSBundle bundleForClass:[self class]] pathForResource:@"MPPortProcess" ofType:@""]];
+ [aTask setArguments:args];
+ [aTask launch];
+
+ NSLog(@"Going to sleep");
+ [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:10000]];
id theProxy = [NSConnection
rootProxyForConnectionWithRegisteredName:@"MPPortProcess"
host:nil];
Modified: branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.h
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.h 2009-07-12 20:39:39 UTC (rev 53716)
+++ branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.h 2009-07-12 20:41:59 UTC (rev 53717)
@@ -11,6 +11,7 @@
@interface MPPortProcess : NSObject {
Tcl_Interp *interpreter;
NSString *PKGPath;
+ NSString *InitTclPath;
}
- (oneway void)evaluateString:(bycopy id)statement;
Modified: branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.m
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.m 2009-07-12 20:39:39 UTC (rev 53716)
+++ branches/gsoc09-gui/MacPorts_Framework/MPPortProcess.m 2009-07-12 20:41:59 UTC (rev 53717)
@@ -17,8 +17,9 @@
@implementation MPPortProcess
-- (id)initWithPKGPath:(NSString*)path {
- PKGPath = path;
+- (id)initWithPKGPath:(NSString*)pkgPath initTclPath:(NSString*)tclPath {
+ PKGPath = pkgPath;
+ InitTclPath = tclPath;
[self initializeInterpreter];
return self;
}
@@ -66,10 +67,12 @@
NSConnection *portProcessConnection;
portProcessConnection = [NSConnection defaultConnection];
NSString *PKGPath = [[NSString alloc] initWithCString:argv[1] encoding:NSUTF8StringEncoding];
- MPPortProcess *portProcess = [[MPPortProcess alloc] initWithPKGPath:PKGPath];
+ NSString *portProcessInitPath = [[NSString alloc] initWithCString:argv[2] encoding:NSUTF8StringEncoding];
+ MPPortProcess *portProcess = [[MPPortProcess alloc] initWithPKGPath:PKGPath initTclPath:portProcessInitPath];
+
// Vending portProcess
- [portProcessConnection setRootObject:portProcess];
+ [portProcessConnection setRootObject:portProcess];
// Register the named connection
if ( [portProcessConnection registerName:@"MPPortProcess"] ) {
Modified: branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2009-07-12 20:39:39 UTC (rev 53716)
+++ branches/gsoc09-gui/MacPorts_Framework/MacPorts.Framework.xcodeproj/project.pbxproj 2009-07-12 20:41:59 UTC (rev 53717)
@@ -90,7 +90,7 @@
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
proxyType = 1;
- remoteGlobalIDString = 21D9543D100940EE00DEF58A /* MPPortProcess */;
+ remoteGlobalIDString = 21D9543D100940EE00DEF58A;
remoteInfo = MPPortProcess;
};
6E1AE8460E232D0700F6D7BC /* PBXContainerItemProxy */ = {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090712/c15b8ca8/attachment.html>
More information about the macports-changes
mailing list