[darwinbuild-changes] [847] trunk/darwinxref/plugins/exportIndex.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 23 15:17:34 PDT 2010


Revision: 847
          http://trac.macosforge.org/projects/darwinbuild/changeset/847
Author:   wsiegrist at apple.com
Date:     2010-06-23 15:17:33 -0700 (Wed, 23 Jun 2010)
Log Message:
-----------
exportIndex: fix arg parsing so -xml works. Change to new CF API for 10.6 support.

Modified Paths:
--------------
    trunk/darwinxref/plugins/exportIndex.c

Modified: trunk/darwinxref/plugins/exportIndex.c
===================================================================
--- trunk/darwinxref/plugins/exportIndex.c	2010-06-23 16:36:33 UTC (rev 846)
+++ trunk/darwinxref/plugins/exportIndex.c	2010-06-23 22:17:33 UTC (rev 847)
@@ -44,19 +44,21 @@
 		CFStringRef arg = CFArrayGetValueAtIndex(argv, 0);
 		xml = CFEqual(arg, CFSTR("-xml"));
 		// -xml is the only supported option
-		if (xml && count >= 2) {
+		if (xml && count == 2) {
 			build = CFArrayGetValueAtIndex(argv, 1);
-		} else if (count == 1) {
+		} else if (!xml && count == 1) {
 			build = arg;
-		} else {
-			return -1;
 		}
 	}
 	
 	CFPropertyListRef plist = DBCopyBuildPlist(build);
 	if (xml) {
-		CFDataRef data = CFPropertyListCreateXMLData(NULL, plist);
-		res = write(STDOUT_FILENO, CFDataGetBytePtr(data), CFDataGetLength(data));
+	  CFDataRef data = CFPropertyListCreateData(kCFAllocatorDefault, 
+						    plist, 
+						    kCFPropertyListXMLFormat_v1_0,
+						    0,
+						    NULL);
+	  res = write(STDOUT_FILENO, CFDataGetBytePtr(data), CFDataGetLength(data));
 	} else {
 		res = writePlist(stdout, plist, 0);
 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100623/d406a18c/attachment.html>


More information about the darwinbuild-changes mailing list