6143d4dc8885827032066b2c91a36a7343147cc7 kent Sat Jan 8 21:04:34 2011 -0800 Making trackHub tolerate 'on' and 'off' in a parent line in trackDb.ra file. diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c index b0ca276..a30c4b2 100644 --- src/hg/lib/trackHub.c +++ src/hg/lib/trackHub.c @@ -264,39 +264,41 @@ /* Make bigDataUrls more absolute rather than relative to genome.ra dir */ struct trackDb *tdb; for (tdb = tdbList; tdb != NULL; tdb = tdb->next) expandBigDataUrl(hub, genome, tdb); /* Connect up subtracks and parents. Note this loop does not actually move tracks * from list to parent subtracks, it just uses the field as a marker. Just do this * so when doing error checking can distinguish between container tracks and others. * This does have the pleasant side effect of making good error messages for * non-existant parents. */ struct hash *hash = hashNew(0); for (tdb = tdbList; tdb != NULL; tdb = tdb->next) hashAdd(hash, tdb->track, tdb); for (tdb = tdbList; tdb != NULL; tdb = tdb->next) { - char *parentName = trackDbLocalSetting(tdb, "parent"); - if (parentName != NULL) + char *parentLine = trackDbLocalSetting(tdb, "parent"); + if (parentLine != NULL) { + char *parentName = cloneFirstWord(parentLine); struct trackDb *parent = hashFindVal(hash, parentName); if (parent == NULL) errAbort("Parent %s of track %s doesn't exist in hub %s genome %s", parentName, tdb->track, hub->url, genome->name); tdb->parent = parent; parent->subtracks = tdb; + freeMem(parentName); } } hashFree(&hash); /* Loop through list checking tags and removing ad-hoc use of parent and subtracks tags. */ for (tdb = tdbList; tdb != NULL; tdb = tdb->next) { checkTagsLegal(hub, genome, tdb); tdb->parent = tdb->subtracks = NULL; } trackDbAddTableField(tdbList); trackHubAddNamePrefix(hub->name, tdbList); trackHubAddGroupName(hub->name, tdbList); for (tdb = tdbList; tdb != NULL; tdb = tdb->next)