[darwinbuild-changes] [283] trunk/darwinxref/DBDataStore.c
source_changes at macosforge.org
source_changes at macosforge.org
Wed Oct 4 02:02:18 PDT 2006
Revision: 283
http://trac.macosforge.org/projects/darwinbuild/changeset/283
Author: kevin
Date: 2006-10-04 02:02:18 -0700 (Wed, 04 Oct 2006)
Log Message:
-----------
- include inherited build aliases in DBCopyOneProjectNames (crazy but correct).
Modified Paths:
--------------
trunk/darwinxref/DBDataStore.c
Modified: trunk/darwinxref/DBDataStore.c
===================================================================
--- trunk/darwinxref/DBDataStore.c 2005-09-29 21:16:15 UTC (rev 282)
+++ trunk/darwinxref/DBDataStore.c 2006-10-04 09:02:18 UTC (rev 283)
@@ -274,9 +274,25 @@
CFArrayRef DBCopyOneProjectNames(CFStringRef build) {
char* cbuild = strdup_cfstr(build);
- CFArrayRef res = SQL_CFARRAY("SELECT DISTINCT project FROM properties WHERE build=%Q ORDER BY project", cbuild);
+
+ CFMutableArrayRef projects = (CFMutableArrayRef)SQL_CFARRAY("SELECT DISTINCT project FROM properties WHERE build=%Q", cbuild);
+
+ // also include any build aliases for these projects
+ do {
+ CFArrayRef res = SQL_CFARRAY("SELECT DISTINCT project FROM properties WHERE build=%Q AND property='original'", cbuild);
+ free(cbuild);
+
+ arrayAppendArrayDistinct(projects, res);
+ CFRelease(res);
+
+ build = DBCopyOnePropString(build, NULL, CFSTR("inherits"));
+ cbuild = strdup_cfstr(build);
+ } while (build != NULL);
+
+ CFArraySortValues(projects, CFRangeMake(0, CFArrayGetCount(projects)), (CFComparatorFunction)CFStringCompare, 0);
+
free(cbuild);
- return res;
+ return projects;
}
CFArrayRef DBCopyProjectNames(CFStringRef build) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/e5a7567e/attachment-0001.html
More information about the darwinbuild-changes
mailing list