f154c7d4f9612d24dd047c593c949dd7b389b79e
galt
  Wed Feb 27 12:29:58 2019 -0800
code cleanup

diff --git src/hg/hgSession/backup.c src/hg/hgSession/backup.c
index 11d407e..ce371aa 100644
--- src/hg/hgSession/backup.c
+++ src/hg/hgSession/backup.c
@@ -164,31 +164,31 @@
     {
     puts(lines[line]);
     if (startsWith("setTimeout(function(){location = location;}", lines[line]))
 	autoRefreshFound = TRUE;
     if (startsWith("Output has been successfully uploaded", lines[line]))
 	successfullyUploaded = TRUE;
     }
 // if it looks like the background is no longer running, 
 // include the .err stdout output for more informative problem message
 char urlErr[512];
 char *textErr = NULL;
 safef(urlErr, sizeof urlErr, "%s.err", url);
 if (!autoRefreshFound && !successfullyUploaded && (fileSize(urlErr) > 0))
     {
     readInGulp(urlErr, &textErr, NULL);
-    //printf("%s", textErr); /* DEBUG REMOVE? more annoying than helpful in some places. */
+    //printf("%s", textErr); /* more annoying than helpful in some places. */
     }
 }
 
 
 
 void startBackgroundWork(char *exec, char **pWorkUrl)
 /* deal with forking off child for background work
  * and setting up the trash file for communicating
  * from the child to the browser */
 {
 char *workUrl = NULL;
 char hgsid[64];
 struct tempName tn;
 safef(hgsid, sizeof(hgsid), "%s", cartSessionId(cart));
 trashDirFile(&tn, "backGround", hgsid, ".tmp");
@@ -579,65 +579,57 @@
 
 struct downloadResults *result = NULL;
 
 
 int ctCount = 0;
 long totalDataToDownload = 0;
 
 for (result=resultList; result; result=result->next)
     {
 
     if (!result->ctPath)  // ct.bed was missing for the db
 	continue;
 
     printf("<h3>Database %s</h3>\n", result->db);
 
-    //printf("result->ctPath %s <br>\n", result->ctPath);  // DEBUG REMOVE
-
     if (startsWith("hub_", result->db))
 	{
 	unsigned hubId = isLiveHub(result->db, NULL, TRUE);
 	if (hubId == 0)
 	    {
 	    printf("Skipping HUB Database %s. "
 		"This hub db is not currently available and will not get backed up.<BR><BR>\n", result->db);
 	    continue; // skip db if not active.
 	    }
 	}
     else
 	{
 	if (!isActiveDb(result->db))
 	    {
 	    printf("Skipping Database %s. "
 		"The db is not currently active and will not get backed up.<BR><BR>\n", result->db);
 	    continue; // skip db if not active.
 	    }
 	}
 
     struct customTrack *cts = result->cts, *track = NULL;
     struct ctExtra *extras = result->ctExtras, *extra = NULL;
 
     printf("<table>\n");
 
     for (track=cts,extra=extras; track; track=track->next,extra=extra->next)
 	{
-	//printf("track name %s <br>\n", extra->name);  // DEBUG REMOVE
-	//printf("track->dbTrack %d <br>\n", track->dbTrack);  // DEBUG REMOVE
-	//printf("track->dbTableName %s <br>\n", track->dbTableName);  // DEBUG REMOVE
-	//printf("track->dbTrackType %s <br>\n", track->dbTrackType);  // DEBUG REMOVE
-	//printf("track->dbDataLoad %d <br>\n", track->dbDataLoad);  // DEBUG REMOVE
-	//printf("extra->bigDataUrl %s <br>\n", extra->bigDataUrl);  // DEBUG REMOVE
 
 	boolean wibMissing = track->wibFile && !fileExists(track->wibFile);
 
 	if (extra->bigDataUrl || (track->dbTrack && track->dbDataLoad && track->dbTableName && !wibMissing))
 	    {
 	    long trackDataToDownload = 0;
 
 	    ++ctCount;
 
 	    if (!extra->bigDataUrl)
 		{
 		char greek[32];
 		sprintWithGreekByte(greek, sizeof(greek), extra->tableDataLength);
 		trackDataToDownload += extra->tableDataLength;
 
@@ -996,87 +988,75 @@
 	else
 	    {
 	    if (!isActiveDb(result->db))
 		{
 		continue; // skip db if not active.
 		}
 	    }
 
 
 	printf("<h3>%s</h3>\n", result->db);
 	dyStringPrintf(dyProg,"<h3>%s</h3>\n", result->db); 
 	updateProgessFile(backgroundProgress, dyProg);
 	lazarusLives(20 * 60);
 
 	
-	//printf("result->ctPath %s <br>\n", result->ctPath);  // DEBUG REMOVE
-
-
 	if (startsWith("hub_", result->db))
 	    {
 	    // Save the hubUrl now in case it gets restored on another machine
 	    // that does NOT have that hub loaded on it.
 	    // save output as hubUrl text file 
 	    char hubUrlPath[1024];
 	    safef(hubUrlPath, sizeof hubUrlPath, "%s/hubUrl", outDbDir);
 	    FILE *f = mustOpen(hubUrlPath, "w");
 	    fprintf(f, "%s", hubUrl);  // NO NEWLINE
 	    carefulClose(&f);
 	    }
 
 	char cwd[PATH_LEN];
 	if (!getcwd(cwd, sizeof(cwd)))
 	    errnoAbort("unable to get current dir.");		
 
 	for (track=cts,extra=extras; track; track=track->next,extra=extra->next)
 	    {
 
-	    //printf("track name %s <br>\n", extra->name);  // DEBUG REMOVE
-	    //printf("track->dbTrack %d <br>\n", track->dbTrack);  // DEBUG REMOVE
-	    //printf("track->dbTableName %s <br>\n", track->dbTableName);  // DEBUG REMOVE
-	    //printf("track->dbTrackType %s <br>\n", track->dbTrackType);  // DEBUG REMOVE
-	    //printf("track->dbDataLoad %d <br>\n", track->dbDataLoad);  // DEBUG REMOVE
-	    //printf("extra->bigDataUrl %s <br>\n", extra->bigDataUrl);  // DEBUG REMOVE
-
 	    boolean wibMissing = track->wibFile && !fileExists(track->wibFile);
 
 	    if (extra->bigDataUrl || (track->dbTrack && track->dbDataLoad && track->dbTableName && !wibMissing))
 		{
 
 		++ctCount;
 		printf("%s <br>\n", extra->name);
 
 		dyStringPrintf(dyProg, "%s <br>\n", extra->name);
 		updateProgessFile(backgroundProgress, dyProg);
 		lazarusLives(20 * 60);
 
 
 		char outNameCt[2014];
 		safef(outNameCt, sizeof outNameCt, "%s/%s.ct", outDbDir, extra->name);
 		FILE *fct = mustOpen(outNameCt, "w");
 
 		// write the track header
 		if (extra->browserLines)
 		    fprintf(fct, "%s", extra->browserLines);  // should have ; converted \n already
 
 		if (!extra->trackLine)
 		    errAbort("origTrackLine is NULL!");
 		fprintf(fct, "%s\n", extra->trackLine);
     
 
-		//printf("%s <br>\n", track->wibFile);  // DEBUG REMOVE
-		
 		if (!extra->bigDataUrl)
 		    {
 
 		    // handle wiggle cts which have an additional wig binary
 		    // wibFile='../trash/ct/hgtct_genome_542_dc1750.wib'
 		    // wibFile='../trash/ct/ct_hgwdev_galt_e83f_3892d0.maf'
 		    // wibFile='../trash/ct/ct_hgwdev_galt_4ba3_415cc0.vcf'
 		    // symlink for speed, file should not change
 		    if (track->wibFile)
 			{
 			if (endsWith(track->wibFile, ".wib"))
 			    {
 			    // dump wig as ascii
 			    char outNameWig[2014];
 			    safef(outNameWig, sizeof outNameWig, "%s/%s.wig", outDbDir, extra->name);