b02d20dede590203b6ecca10be473e7e22179a51 braney Thu Jan 12 13:12:53 2023 -0800 deal with some weird edge cases in hub that Hiram's hub illicit. Don't read a single trackDb.txt file more than once even if it's referenced from mulitple hubs. Also, only the first time a genome is defined does it get to populate its own groups. Subsequent examples get put into their own group, just like a normal track hub does. diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 443c3ff..67240d6 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -875,31 +875,32 @@ return (count >= 0 && count <= HDB_MAX_SEQS_FOR_SPLIT); } static void tableListHashAdd(struct hash *dbTblHash, char *profile, char *db) /* Add to a hash that maps a track/table name (unsplit) to an slName list * of actual table names (possibly split) -- we can compute this once and * cache it to save a lot of querying if we will check existence of * lots of tables. */ { if (trackHubDatabase(db)) { struct trackHub *hub = hubConnectGetHubForDb(db); if (hub != NULL) { struct trackHubGenome *hubGenome = trackHubFindGenome(hub, db); - struct trackDb *tdbList = trackHubTracksForGenome(hub, hubGenome, NULL), *tdb; + boolean foundFirstGenome = FALSE; + struct trackDb *tdbList = trackHubTracksForGenome(hub, hubGenome, NULL, &foundFirstGenome), *tdb; for (tdb = tdbList; tdb != NULL; tdb = tdb->next) { hashAdd(dbTblHash, tdb->table, slNameNew(tdb->table)); } } return; } struct sqlConnection *conn = hAllocConnProfileMaybe(profile, db); if (conn == NULL) // Database does not exist, so no tables in the database exist -- leave the hash empty. return; struct slName *allTables = sqlListTables(conn); if (!sameString(CUSTOM_TRASH,db) && !sameString("hgFixed",db) && hCanHaveSplitTables(db)) {