4727e0251c76f69905d0748adab43484166d6870 angie Fri Mar 14 16:42:14 2014 -0700 In code review, Max pointed out that it's non-standard to conditionallyinclude header files in the middle of a .c file. While looking at it, I realized that there were a lot of unnecessary #ifdef's for KNETFILE_HOOKS in general, all because there was not yet an #else implementation of knetUdcInstall, which can be a no-op if KNETFILE_HOOKS is not used. So I yanked out a lot of unnecessary old stuff, and tested basic bam and vcf track operations with a few settings: USE_SAMTABIX USE_BAM USE_TABIX KNETFILE_HOOKS 1 (these tree are all implied by USE_SAMTABIX) 0 1 0 0 0 1 0 1 0 0 1 1 USE_TABIX without KNETFILE_HOOKS doesn't work because the tabix lib wants to download .tbi files into the current working directory, cgi-bin, and we don't allow that (and shouldn't!). If we were going to support that, we could add a change-dir solution as in bamFile.c, but I don't think we need to support it now that there's samtabix. refs #6235, refs #12850 diff --git src/hg/hgCustom/hgCustom.c src/hg/hgCustom/hgCustom.c index 19fc6db..eafc644 100644 --- src/hg/hgCustom/hgCustom.c +++ src/hg/hgCustom/hgCustom.c @@ -2,34 +2,32 @@ #include "common.h" #include "obscure.h" #include "linefile.h" #include "hash.h" #include "cart.h" #include "cheapcgi.h" #include "web.h" #include "htmshell.h" #include "hdb.h" #include "hui.h" #include "hCommon.h" #include "customTrack.h" #include "customFactory.h" #include "portable.h" #include "errCatch.h" -#if ((defined USE_BAM || defined USE_TABIX) && defined KNETFILE_HOOKS) #include "knetUdc.h" #include "udc.h" -#endif//def (USE_BAM || USE_TABIX) && KNETFILE_HOOKS #include "net.h" #include "jsHelper.h" #include <signal.h> #include "trackHub.h" static long loadTime = 0; void usage() /* Explain usage and exit. */ { errAbort( "hgCustom - Custom track management CGI\n" "usage:\n" " hgCustom <CGI settings>\n" @@ -1101,35 +1099,33 @@ char *err = NULL, *warn = NULL; char *selectedTable = NULL; struct customTrack *ct = NULL; boolean ctUpdated = FALSE; char *initialDb = NULL; long thisTime = clock1000(); cart = theCart; measureTiming = isNotEmpty(cartOptionalString(cart, "measureTiming")); initialDb = cloneString(cartString(cart, "db")); getDbAndGenome(cart, &database, &organism, oldVars); customFactoryEnableExtraChecking(TRUE); -#if ((defined USE_BAM || defined USE_TABIX) && defined KNETFILE_HOOKS) knetUdcInstall(); if (udcCacheTimeout() < 300) udcSetCacheTimeout(300); -#endif//def (USE_BAM || USE_TABIX) && KNETFILE_HOOKS if (sameString(initialDb, "0")) { /* when an organism is selected from the custom track management page, * set the database to be the default only if it has custom tracks. * Otherwise, pick an assembly for that organism that does have custom tracks. */ struct dbDb *dbDb, *dbDbs = getCustomTrackDatabases(); char *dbWithCts = NULL; for (dbDb = dbDbs; dbDb != NULL; dbDb = dbDb->next) { if (sameString(database, dbDb->name)) break; if (sameString(organism, dbDb->organism)) { if (!dbWithCts)