[22728] users/rhwood/Pallet/PortAuthority.m

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 12 18:56:09 PDT 2007


Revision: 22728
          http://trac.macosforge.org/projects/macports/changeset/22728
Author:   rhwood at macports.org
Date:     2007-03-12 18:56:08 -0700 (Mon, 12 Mar 2007)

Log Message:
-----------
Add @try... at catch to catch exceptions testing for the first character of the long_description.
Remove debugging statements from the testing for the first character of the long_description.

Modified Paths:
--------------
    users/rhwood/Pallet/PortAuthority.m

Modified: users/rhwood/Pallet/PortAuthority.m
===================================================================
--- users/rhwood/Pallet/PortAuthority.m	2007-03-13 00:37:08 UTC (rev 22727)
+++ users/rhwood/Pallet/PortAuthority.m	2007-03-13 01:56:08 UTC (rev 22728)
@@ -182,10 +182,19 @@
 				[port setValue:value forKey:key];
 				//NSLog(@"%@: %@\n", key, value);
 			}
-			NSLog(@"\n\nparsing %@\n\n", [port valueForKey:@"name"]);
-			if ([[port valueForKey:@"long_description"] characterAtIndex:0] == '{') {
-				NSLog(@"\n\nchanging %@\n\n", [port valueForKey:@"name"]);
-				[port setValue:[port valueForKey:@"description"] forKey:@"long_description"];
+			@try {
+				if ([[port valueForKey:@"long_description"] characterAtIndex:0] == '{') {
+					[port setValue:[port valueForKey:@"description"] forKey:@"long_description"];
+				}
+			} 
+			@catch (NSException *e) {
+				[port setValue:[NSString stringWithFormat:
+					NSLocalizedStringWithDefaultValue(@"parsePortIndexDescreiptionError",
+													  @"Localizable",
+													  [NSBundle mainBundle],
+													  @"Port has an invalid desciption or long_description key.",
+													  @"Error statement for exception raised when testing long_description.")]
+						forKey:@"long_description"];
 			}
 			// generate a composite version string: version_revision
 			[port setValue:[[[port valueForKey:@"version"] stringByAppendingString:@"_"] stringByAppendingString:[port valueForKey:@"revision"]] forKey:@"compositeVersion"];

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070312/4e4a4f3d/attachment.html


More information about the macports-changes mailing list