src/hg/lib/customFactory.c 1.97
1.97 2009/05/18 21:36:41 galt
add touching of udc files in cache and reporting of names for the do-not-kill-list with verbose=4
Index: src/hg/lib/customFactory.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/customFactory.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -b -B -U 4 -r1.96 -r1.97
--- src/hg/lib/customFactory.c 10 Feb 2009 22:12:08 -0000 1.96
+++ src/hg/lib/customFactory.c 18 May 2009 21:36:41 -0000 1.97
@@ -23,8 +23,9 @@
#include "customFactory.h"
#include "trashDir.h"
#include "jsHelper.h"
#include "encode/encodePeak.h"
+#include "udc.h"
static char const rcsid[] = "$Id$";
/*** Utility routines used by many factories. ***/
@@ -2171,8 +2172,27 @@
hashElFreeList(&fileSettings);
return isLive;
}
+static void touchUdcSettings(struct trackDb *tdb)
+/* Touch existing local udcCache bitmap and sparse files. */
+{
+char *url = trackDbSetting(tdb, "dataUrl");
+if (url)
+ {
+ struct slName *el, *list = udcFileCacheFiles(url, udcDefaultDir());
+ for (el = list; el; el = el->next)
+ {
+ if (fileExists(el->name))
+ {
+ readAndIgnore(el->name);
+ verbose(4, "setting dataUrl: %s\n", el->name);
+ }
+ }
+ slFreeList(&list);
+ }
+}
+
void customFactoryTestExistence(char *genomeDb, char *fileName, boolean *retGotLive,
boolean *retGotExpired)
/* Test existence of custom track fileName. If it exists, parse it just
* enough to tell whether it refers to database tables and if so, whether
@@ -2235,10 +2255,16 @@
/* don't verify database for custom track -- we might be testing existence
* for another database. */
+
+ /* Handle File* settings */
isLive = (isLive && testFileSettings(track->tdb, fileName));
+
+ /* Handle dataUrl udc settings */
+ touchUdcSettings(track->tdb);
+
if (track->dbDataLoad)
/* Track was loaded into the database -- check if it still exists. */
{
if (ctConn && ctDbTableExists(ctConn, track->dbTableName))