a71c186cb86722896fa8767712172c58da819bcb
galt
  Thu Aug 15 12:07:14 2019 -0700
codreview and cleanup

diff --git src/hg/utils/blatServersCheck/blatServersCheck.c src/hg/utils/blatServersCheck/blatServersCheck.c
index 73061c6..f5617a3 100644
--- src/hg/utils/blatServersCheck/blatServersCheck.c
+++ src/hg/utils/blatServersCheck/blatServersCheck.c
@@ -23,47 +23,35 @@
 struct sqlConnection *conn = NULL;
 
 char *blatServersTableName = "blatServers";
 
 void usage()
 /* Explain usage and exit. */
 {
 errAbort(
   "blatServersCheck - Check the blatServers table matches running gfServers\n"
   "usage:\n"
   "   blatServersCheck profile\n"
   "profile should be from hg.conf like central or rrcentral\n"
   "options:\n"
   " -verbose=2  can show details for each server.\n"
   "\n"
-// TODO copied from another progrma, not sure it still works here.
-//  "Use the HGDB_CONF environment variable to specify which configuration to use, for example\n"
-//  "HGDB_CONF=/usr/local/apache/cgi-bin/hg.conf\n"
   );
 }
 
 
 static struct optionSpec options[] = {
-/*
-   {"chunkSize", OPTION_INT},
-   {"chunkWait", OPTION_INT},
-   {"squealSize", OPTION_INT},
-   {"purgeStart", OPTION_INT},
-   {"purgeEnd", OPTION_INT},
-   {"purgeTable", OPTION_STRING},
-   {"dryRun", OPTION_STRING},
-*/
    {"-help", OPTION_BOOLEAN},
    {NULL, 0},
 };
 
 char *getCfgOption(char *config, char *setting)
 /* get setting for specified config */
 {
 char temp[256];
 safef(temp, sizeof(temp), "%s.%s", config, setting);
 char *value = cfgOption(temp);
 if (!value)
     errAbort("setting %s not found!",temp);
 return value;
 }
 
@@ -169,31 +157,31 @@
 
 /* Put together command. */
 sd = netMustConnectTo(hostName, portName);
 sprintf(buf, "%sfiles", gfSignature());
 mustWriteFd(sd, buf, strlen(buf));
 
 /* Get count of files, and then each file name. */
 if (netGetString(sd, buf) != NULL)
     {
     fileCount = atoi(buf);
     for (i=0; i<fileCount; ++i) // could have multiples if .nib used?
 	{
 	char *fileName = netRecieveString(sd, buf);
 	//printf("%s\n", fileName);
 	verbose(2, "%s\n", fileName);
-	// if .nib or Kg genes for isPcr, cannot confirm the name.
+	// if .nib, cannot confirm the name.
 	if (endsWith(fileName,".nib"))
             {
 	    // DO NOTHING FOR NIBS
 	    }
         else if (strstr(db, "Kg"))
 	    {
 	    struct hashEl *hel = hashLookup(targetDbHash, db);
 	    if (hel == NULL)
 		{
 		warn("db %s not found in targetDb.name, probably obsolete", db);
 		ret = -2;  // name mot found in targetDb, probably obsolete
 		break;
 		}
 	    else
 		{
@@ -329,45 +317,36 @@
 
 sqlFreeResult(&sr);
 sqlDisconnect(&conn);
 
 // Show a count of how many servers were of each gfServer version
 struct hashEl *el, *list = hashElListHash(versionHash);
 slSort(&list, hashElCmp);
 verbose(1, "version count\n");
 verbose(1, "-------------\n");
 for (el = list; el != NULL; el = el->next)
    {
    verbose(1, "%s %d\n", el->name, ptToInt(el->val));
    }
 hashElFreeList(&list);
 
-for (el = list; el != NULL; el = el->next)
-   {
-   verbose(1, "%s %d\n", el->name, ptToInt(el->val));
-   }
-hashElFreeList(&list);
 verbose(1, "\n");
 
 if (errCount > 0)
     errAbort("error count=%d", errCount);
 }
 
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 optionInit(&argc, argv, options);
 
 if ((argc != 2) || optionExists("-help"))
     usage();
 
-//char *hgdbConf = getenv("HGDB_CONF");
-//if (hgdbConf)
-//    printf("\nHGDB_CONF = %s\n\n", hgdbConf);
-
 blatServersCheck(argv[1]);
 
 printf("No errors found!\n");
 
 return 0;  
 }