[48446] users/toby/objcports/MPParser.m

toby at macports.org toby at macports.org
Sun Mar 22 01:25:29 PDT 2009


Revision: 48446
          http://trac.macports.org/changeset/48446
Author:   toby at macports.org
Date:     2009-03-22 01:25:29 -0700 (Sun, 22 Mar 2009)
Log Message:
-----------
platform

Modified Paths:
--------------
    users/toby/objcports/MPParser.m

Modified: users/toby/objcports/MPParser.m
===================================================================
--- users/toby/objcports/MPParser.m	2009-03-22 08:21:22 UTC (rev 48445)
+++ users/toby/objcports/MPParser.m	2009-03-22 08:25:29 UTC (rev 48446)
@@ -80,8 +80,9 @@
 		// (ugh, more tcl parsing)
 	} else if ([command isEqualToString:@"platform"]) {
 		NSUInteger count = [args count];
-		NSString *os, *arch = nil;
-		NSInteger release = 0;
+		NSString *os = nil;
+		id release = [NSNull null];
+		id arch = [NSNull null];
 
 		if (count < 2 || count > 4) {
 			NSLog(@"bogus platform declaration");
@@ -89,20 +90,20 @@
 		}
 
 		os = [args objectAtIndex:0];
+
 		if (count == 3) {
-			release = [[args objectAtIndex:1] integerValue];
-			arch = release ? nil : [args objectAtIndex:1];
+			NSInteger rel = [[args objectAtIndex:1] integerValue];
+			if (rel != 0) {
+				release = [NSNumber numberWithInteger:rel];
+			} else {
+				arch = [args objectAtIndex:1];
+			}
 		} else if (count == 4) {
-			release = [[args objectAtIndex:1] integerValue];
+			release = [NSNumber numberWithInteger:[[args objectAtIndex:1] integerValue]];
 			arch = [args objectAtIndex:2];
 		}
 
-		NSString *platformFull = [NSString stringWithFormat:@"%@%@%@",
-			os,
-			release ? [NSString stringWithFormat:@"_%ld", release] : @"",
-			arch ? [NSString stringWithFormat:@"_%@", arch] : @""];
-
-		if ([_port addPlatform:platformFull]) {
+		if ([_port addPlatform:[NSArray arrayWithObjects:os, release, arch, nil]]) {
 			Tcl_Eval(_interp, [[args lastObject] UTF8String]);
 		}
 	} else if ([command isEqualToString:@"variant"]) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090322/71b3a470/attachment.html>


More information about the macports-changes mailing list