a5cd114e4b68544136bf74576d7a249f91450beb
jcasper
  Thu Jun 15 15:44:40 2017 -0700
hgHubConnect needed to support an hg.conf-specified cache directory for search, refs #13625

diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c
index 1b216e7..6a7c49c 100644
--- src/hg/hgHubConnect/hgHubConnect.c
+++ src/hg/hgHubConnect/hgHubConnect.c
@@ -852,31 +852,32 @@
         }
     printf("</ul></li></ul></div>\n");
     }
 }
 
 
 void printHubList(struct slName *hubsToPrint, struct hash *hubLookup, struct hash *searchResultHash)
 /* Print out a list of hubs, possibly along with search hits to those hubs.
  * hubLookup takes hub URLs to struct hubEntry
  * searchResultHash takes hub URLs to struct hubSearchText * (list of hits on that hub)
  */
 {
 int count = 0;
 int udcTimeoutVal = udcCacheTimeout();
 char *udcOldDir = cloneString(udcDefaultDir());
-udcSetDefaultDir("/hive/users/jcasper/hubCrawl/");
+char *searchUdcDir = cfgOptionDefault("hgHubConnect.cacheDir", udcOldDir);
+udcSetDefaultDir(searchUdcDir);
 udcSetCacheTimeout(1<<30);
 if (hubsToPrint != NULL)
     {
     printHubListHeader();
 
     if (searchResultHash == NULL) // if not displaying search results, join the hub <tr>s into one table
         printf("<table class='hubList'><tbody>\n");
     struct slName *thisHubName = NULL;
     for (thisHubName = hubsToPrint; thisHubName != NULL; thisHubName = thisHubName->next)
         {
         struct hubEntry *hubInfo = (struct hubEntry *) hashFindVal(hubLookup, thisHubName->name);
         if (hubInfo == NULL)
             {
             /* This shouldn't happen often, but maybe the search hits list was built from an outdated
              * search text file that includes hubs for which no info is available.