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/hgTables/hgTables.c src/hg/hgTables/hgTables.c index a132603..e52ff39 100644 --- src/hg/hgTables/hgTables.c +++ src/hg/hgTables/hgTables.c @@ -20,33 +20,31 @@ #include "grp.h" #include "customTrack.h" #include "pipeline.h" #include "hgFind.h" #include "hgTables.h" #include "joiner.h" #include "bedCart.h" #include "hgMaf.h" #include "gvUi.h" #include "wikiTrack.h" #include "trackHub.h" #include "hubConnect.h" #include "hgConfig.h" #include "udc.h" #include "chromInfo.h" -#if ((defined USE_BAM || defined USE_TABIX) && defined KNETFILE_HOOKS) #include "knetUdc.h" -#endif//def (USE_BAM || USE_TABIX) && KNETFILE_HOOKS void usage() /* Explain usage and exit. */ { errAbort( "hgTables - Get table data associated with tracks and intersect tracks\n" "usage:\n" " hgTables XXX\n" "options:\n" " -xxx=XXX\n" ); } /* Global variables. */ struct cart *cart; /* This holds cgi and other variables between clicks. */ @@ -1973,33 +1971,31 @@ setUdcCacheDir(); oldVars = hashNew(10); /* Sometimes we output HTML and sometimes plain text; let each outputter * take care of headers instead of using a fixed cart*Shell(). */ cart = cartAndCookieNoContent(hUserCookie(), excludeVars, oldVars); /* Set up global variables. */ allJoiner = joinerRead("all.joiner"); getDbGenomeClade(cart, &database, &genome, &clade, oldVars); freezeName = hFreezeFromDb(database); int timeout = cartUsualInt(cart, "udcTimeout", 300); if (udcCacheTimeout() < timeout) udcSetCacheTimeout(timeout); -#if ((defined USE_BAM || defined USE_TABIX) && defined KNETFILE_HOOKS) knetUdcInstall(); -#endif//def (USE_BAM || USE_TABIX) && KNETFILE_HOOKS /* Init track and group lists and figure out what page to put up. */ initGroupsTracksTables(); if (lookupPosition()) { if (cartUsualBoolean(cart, hgtaDoGreatOutput, FALSE)) doGetGreatOutput(dispatch); else dispatch(); } else { struct sqlConnection *conn = NULL; if (!trackHubDatabase(database)) conn = curTrack ? hAllocConnTrack(database, curTrack) : hAllocConn(database);