f2d99f0c3d73e67c3c89b318f61bcce0daae599b braney Sat Sep 14 10:25:14 2019 -0700 look for multiple hubUrl on the URL rather than allowing commas in the setting. diff --git src/hg/lib/hubConnect.c src/hg/lib/hubConnect.c index 66db045..fb1bf8e 100644 --- src/hg/lib/hubConnect.c +++ src/hg/lib/hubConnect.c @@ -558,58 +558,50 @@ char **row; while ((row = sqlNextRow(sr)) != NULL) { int id = sqlUnsigned(row[0]); char buffer[512]; safef(buffer, sizeof(buffer), "hgHubConnect.hub.%d", id); cartRemove(cart, buffer); } sqlFreeResult(&sr); hDisconnectCentral(&conn); } static char *checkForNew( struct cart *cart) -/* see if the user just typed in a new hub url, or we have a hubUrl on the - * command line. Return the new database if there is one. */ +/* see if the user just typed in a new hub url, or we have one or more hubUrl + * on the command line. Return the new database if there is one. */ { char *newDatabase = NULL; boolean doClear = FALSE; char *assemblyDb = cartOptionalString(cart, hgHubGenome); char *wantFirstDb = cartOptionalString(cart, hgHubDoFirstDb); -char *urls = cloneString(cartOptionalString(cart, hgHubDataClearText)); +struct slName *urls = cartOptionalSlNameList(cart, hgHubDataClearText); if (urls) doClear = TRUE; else - urls = cloneString(cartOptionalString(cart, hgHubDataText)); - -cartRemove(cart, hgHubDataClearText); -cartRemove(cart, hgHubDataText); + urls = cartOptionalSlNameList(cart, hgHubDataText); if (urls == NULL) return NULL; -char *words[128]; -int count = chopString(urls, ",", words, sizeof words/sizeof(char *)); - -int ii; -for(ii = 0; ii < count; ii++) +for(; urls; urls = urls->next) { - char *url = words[ii]; - + char *url = cloneString(urls->name); if (doClear) disconnectHubsSamePrefix(cart, url); trimSpaces(url); // go and grab the hub and set the cart variables to connect it struct hubConnectStatus *hub; gNewHub = hub = getAndSetHubStatus( cart, url, TRUE); if (newDatabase == NULL) // if we haven't picked a new database yet { if ((wantFirstDb != NULL) && (hub->trackHub != NULL)) // choose the first db newDatabase = hub->trackHub->defaultDb; else if (assemblyDb != NULL) { @@ -621,30 +613,32 @@ struct trackHubGenome *genomeList = trackHub->genomeList; for(; genomeList; genomeList = genomeList->next) { if (sameString(assemblyDb, hubConnectSkipHubPrefix(genomeList->name))) { newDatabase = genomeList->name; break; } } } } } } +cartRemove(cart, hgHubDataClearText); +cartRemove(cart, hgHubDataText); cartRemove(cart, hgHubDoFirstDb); cartRemove(cart, hgHubGenome); return newDatabase; } unsigned hubResetError(char *url) /* clear the error for this url in the hubStatus table,return the id */ { struct sqlConnection *conn = hConnectCentral(); char query[512]; sqlSafef(query, sizeof(query), "select id from %s where hubUrl = \"%s\"", getHubStatusTableName(), url); unsigned id = sqlQuickNum(conn, query); if (id == 0)