[38536] branches/gsoc08-framework/MacPorts_Framework
armahg at macports.org
armahg at macports.org
Thu Jul 24 14:53:40 PDT 2008
Revision: 38536
http://trac.macosforge.org/projects/macports/changeset/38536
Author: armahg at macports.org
Date: 2008-07-24 14:53:40 -0700 (Thu, 24 Jul 2008)
Log Message:
-----------
Removed evaluateArrayAsString method from MPInterpreter class. Randall's alternative suggestion for using evaluateStringAsString with NSString's stringWithFormat: method makes for cleaner code
Modified Paths:
--------------
branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h
branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m
branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
branches/gsoc08-framework/MacPorts_Framework/MPRegistry.m
Modified: branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h 2008-07-24 21:43:08 UTC (rev 38535)
+++ branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.h 2008-07-24 21:53:40 UTC (rev 38536)
@@ -119,7 +119,7 @@
//stuff so i'm only going to document and remove old code after new code is working and i've done
//a commit. Obtaining the return code will make error handling in the framework much less
//cumbersome
-- (NSDictionary *)evaluateArrayAsString:(NSArray *)statement;
+//- (NSDictionary *)evaluateArrayAsString:(NSArray *)statement;
- (NSDictionary *)evaluateStringAsString:(NSString *)statement;
Modified: branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m 2008-07-24 21:43:08 UTC (rev 38535)
+++ branches/gsoc08-framework/MacPorts_Framework/MPInterpreter.m 2008-07-24 21:53:40 UTC (rev 38536)
@@ -235,7 +235,7 @@
#pragma Utilities
-- (NSDictionary *)evaluateArrayAsString:(NSArray *)statement {
+/*- (NSDictionary *)evaluateArrayAsString:(NSArray *)statement {
return [self evaluateStringAsString:[statement componentsJoinedByString:@" "]];
}
Modified: branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m 2008-07-24 21:43:08 UTC (rev 38535)
+++ branches/gsoc08-framework/MacPorts_Framework/MPMacPorts.m 2008-07-24 21:53:40 UTC (rev 38536)
@@ -159,7 +159,7 @@
} else {
caseSensitivity = @"no";
}
- result = [NSMutableDictionary dictionaryWithDictionary:
+ /*result = [NSMutableDictionary dictionaryWithDictionary:
[interpreter dictionaryFromTclListAsString:
[[interpreter evaluateArrayAsString:
[NSArray arrayWithObjects:
@@ -169,8 +169,14 @@
style,
fieldName,
@"]",
- nil]] objectForKey:TCL_RETURN_STRING] ]];
+ nil]] objectForKey:TCL_RETURN_STRING] ]];*/
+ result = [NSMutableDictionary dictionaryWithDictionary:
+ [interpreter dictionaryFromTclListAsString:
+ [[interpreter evaluateStringAsString:
+ [NSString stringWithFormat:@"return [mportsearch %@ %@ %@ %@]",
+ query, caseSensitivity, style, fieldName]] objectForKey:TCL_RETURN_STRING]]];
+
newResult = [NSMutableDictionary dictionaryWithCapacity:[result count]];
enumerator = [result keyEnumerator];
while (key = [enumerator nextObject]) {
Modified: branches/gsoc08-framework/MacPorts_Framework/MPRegistry.m
===================================================================
--- branches/gsoc08-framework/MacPorts_Framework/MPRegistry.m 2008-07-24 21:43:08 UTC (rev 38535)
+++ branches/gsoc08-framework/MacPorts_Framework/MPRegistry.m 2008-07-24 21:53:40 UTC (rev 38536)
@@ -117,16 +117,24 @@
}
- (NSArray *)installedAsArray:(NSString *)name withVersion:(NSString *)version {
- return [interpreter arrayFromTclListAsString:[[interpreter evaluateArrayAsString:[NSArray arrayWithObjects:
- @"return [registry::installed",
- name,
- version,
- @"]",
- nil
- ]] objectForKey:TCL_RETURN_STRING]];
+ /*
+ return [interpreter arrayFromTclListAsString:[[interpreter evaluateArrayAsString:[NSArray arrayWithObjects:
+ @"return [registry::installed",
+ name,
+ version,
+ @"]",
+ nil
+ ]] objectForKey:TCL_RETURN_STRING]];
+ */
+
+ return [interpreter arrayFromTclListAsString:
+ [[interpreter evaluateStringAsString:
+ [NSString stringWithFormat:@"return [registry::installed %@ %@]", name, version]]
+ objectForKey:TCL_RETURN_STRING]];
}
- (NSArray *)filesForPort:(NSString *)name {
+ /*
return [interpreter arrayFromTclListAsString:
[[interpreter evaluateArrayAsString:[NSArray arrayWithObjects:
@"return [registry::port_registered",
@@ -134,6 +142,12 @@
@"]",
nil]]
objectForKey:TCL_RETURN_STRING] ];
+ */
+
+ return [interpreter arrayFromTclListAsString:
+ [[interpreter evaluateStringAsString:
+ [NSString stringWithFormat:@"return [registry::port_registered %@]", name]]
+ objectForKey:TCL_RETURN_STRING]];
}
@end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080724/c1c31098/attachment-0001.html
More information about the macports-changes
mailing list