2c8912b056f0460badfcad9cce2e5c0a8c290c6d
kent
  Tue Jan 12 18:06:55 2021 -0800
Refactoring code so that in both hubs and in built in tracks the same trackDb fields are D substituted for file names so they don't have to be maintained in parallel. Build a new trackSettingIsFile routine to enable this and am calling it in the two places that used to decide whether to do a substitution.

diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c
index 8965f7f..c7ce5ee 100644
--- src/hg/lib/trackDbCustom.c
+++ src/hg/lib/trackDbCustom.c
@@ -1559,30 +1559,42 @@
     if (tabSepMeta)
         return tabSepMetaPairs(tabSepMeta, tdb, metaTag);
 
     char *tagStormFile = trackDbSetting(tdb, "metaDb");
     if (tagStormFile)
         return tagRepoPairs(tagStormFile, "meta", metaTag);
     }
 
 char *metadataInTdb = trackDbSetting(tdb, "metadata");
 if (metadataInTdb)
     return convertNameValueString(metadataInTdb);
 
 return NULL;
 }
 
+boolean trackSettingIsFile(char *setting)
+/* Returns TRUE if setting found in trackDb stanza is a file setting that
+ * would benefit from directory $D substitution among other things - looks for
+ * settings that ends in "Url" and a few others. */
+{
+return endsWith(setting, "Url") ||
+    sameString(setting, "bigDataIndex") ||
+    sameString(setting, "frames") ||
+    sameString(setting, "summary") ||
+    sameString(setting, "searchTrix");
+}
+
 char *labelAsFilteredNumber(char *label, unsigned numOut)
 /* add text to label to indicate filter is active */
 {
 char buffer[2048];
 safef(buffer, sizeof buffer, " (%d items filtered)", numOut);
 return catTwoStrings(label, buffer);
 }
 
 char *labelAsFiltered(char *label)
 /* add text to label to indicate filter is active */
 {
 #define FILTER_ACTIVATED " (filter activated)"
 if (stringIn(FILTER_ACTIVATED, label))
     return label;
 return (catTwoStrings(label, FILTER_ACTIVATED));