11a8523b872977121c76bab2d66693630785520a
max
  Tue Sep 15 02:43:27 2015 -0700
allowing auto-creating of track line from local files, refs #16011

diff --git src/hg/lib/customPp.c src/hg/lib/customPp.c
index 0cc816c..5bd44e6 100644
--- src/hg/lib/customPp.c
+++ src/hg/lib/customPp.c
@@ -2,30 +2,31 @@
  * input/output for the custom track system.  The main services it provides
  * are taking care of references to URLs, which are treated as includes,
  * and moving lines that start with "browser" to a list.
  *
  * Also this allows unlimited "pushBack" of lines, which is handy, since
  * the system will analyse a number of lines of a track to see what format
  * it's in. */
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See README in this or parent directory for licensing information. */
 
 #include "common.h"
 #include "linefile.h"
 #include "net.h"
 #include "customPp.h"
+#include "hgConfig.h"
 #include "customTrack.h"
 #ifdef PROGRESS_METER
 #include "udc.h"
 #endif
 
 
 struct customPp *customDocPpNew(struct lineFile *lf)
 /* Return customPp that will ignore browser lines, for doc files */
 {
 struct customPp *cpp = customPpNew(lf);
 cpp->ignoreBrowserLines = TRUE;
 return cpp;
 }
 
 struct customPp *customPpNew(struct lineFile *lf)
@@ -92,31 +93,31 @@
     cpp->reusedLines = reused->next;
     cpp->inReuse = reused;
     return reused->name;
     }
 
 /* Get next line from file on top of stack.  If at EOF
  * go to next file in stack.  If get a http:// or https:// or ftp:// line
  * open file this references and push it onto stack. Meanwhile
  * squirrel away 'browser' lines. */
 struct lineFile *lf;
 while ((lf = cpp->fileStack) != NULL)
     {
     char *line;
     if (lineFileNext(lf, &line, NULL))
         {
-	if (startsWith("http://", line) || startsWith("https://", line) || startsWith("ftp://", line))
+	if (startsWith("http://", line) || startsWith("https://", line) || startsWith("ftp://", line) || (cfgOption("udc.localDir")!=NULL && startsWith(cfgOption("udc.localDir"), line)) )
 	    {
             if (customTrackIsBigData(line))
                 line = bigUrlToTrackLine(line);
             else
                 {
                 lf = netLineFileOpen(line);
                 slAddHead(&cpp->fileStack, lf);
     #ifdef PROGRESS_METER
                 off_t remoteSize = 0;
                 remoteSize = remoteFileSize(line);
                 cpp->remoteFileSize = remoteSize;
     #endif
                 continue;
                 }
 	    }