f366bb45ff39298eecf6951f4e5f51273ae167d9
tdreszer
  Tue Mar 15 09:39:21 2011 -0700
Special case for beta is not an rsync or an htdocs-downloads solution.
diff --git src/hg/lib/fileUi.c src/hg/lib/fileUi.c
index cc8372a..07130e2 100644
--- src/hg/lib/fileUi.c
+++ src/hg/lib/fileUi.c
@@ -58,32 +58,35 @@
     char cmd[512];
     char *words[10];
     char *server = hDownloadsServer();
 
     boolean useRsync = TRUE;
     if (hIsPrivateHost() || hIsPreviewHost())
         {
         // For hgwdev (which is the same machine as "hgdownload-test.cse.ucsc.edu") rsync does not work
         // Use ls -log --time=ctime --time-style=long-iso /usr/local/apache/htdocs-hgdownload/goldenPath/hg19/encodeDCC/wgEncodeBroadHistone
         safef(cmd,sizeof(cmd),"ls -log --time-style=long-iso /usr/local/apache/htdocs-hgdownload/goldenPath/%s/%s/%s/", db,dir,subDir);
         useRsync = FALSE;
         }
     else if (hIsBetaHost())
         {
         // For hgwbeta, the files are being looked for one test in a "beta/" subdir.  Have to rsync
-        server = "hgdownload-test.cse.ucsc.edu"; // NOTE: Force this case because beta may think it's downloads server is "hgdownload.cse.ucsc.edu"
-        safef(cmd,sizeof(cmd),"rsync -avn rsync://%s/goldenPath/%s/%s/%s/beta/", server, db, dir, subDir);
+        //server = "hgdownload-test.cse.ucsc.edu"; // NOTE: Force this case because beta may think it's downloads server is "hgdownload.cse.ucsc.edu"
+        //safef(cmd,sizeof(cmd),"rsync -avn rsync://%s/goldenPath/%s/%s/%s/beta/", server, db, dir, subDir);
+        // FIXME: Need cluster-admins help to get rsync solution
+        safef(cmd,sizeof(cmd),"ls -log --time-style=long-iso /hive/groups/encode/dcc/pipeline/downloads/%s/%s/beta/", db,subDir);
+        useRsync = FALSE;
         }
     else  // genome and hgwbeta can use rsync
         {
         // Works:         rsync -avn rsync://hgdownload.cse.ucsc.edu/goldenPath/hg18/encodeDCC/wgEncodeBroadChipSeq/
         safef(cmd,sizeof(cmd),"rsync -avn rsync://%s/goldenPath/%s/%s/%s/", server, db, dir, subDir);
         }
     //warn("cmd: %s",cmd);
     scriptOutput = popen(cmd, "r");
     while(fgets(buf, sizeof(buf), scriptOutput))
         {
         eraseTrailingSpaces(buf);
         if (!endsWith(buf,".md5sum")) // Just ignore these
             {
             int count = chopLine(buf, words);
             if (count >= 6 && useRsync == FALSE) // hgwdev is same as hgdownloads-test so can't use rsync
@@ -830,59 +833,58 @@
 if (conn == NULL)
     connLocal = hAllocConn(db);
 struct mdbObj *mdbList = mdbObjRepeatedSearch(connLocal,varValPairs,FALSE,TRUE);
 if (conn == NULL)
     hFreeConn(&connLocal);
 if (slCount(mdbList) == 0)
     {
     printf("<DIV id='filesFound'><BR>No files found.<BR></DIV><BR>\n");
     return 0;
     }
 
 // Now sort mdbObjs so that composites will stay together and lookup of files will be most efficient
 mdbObjsSortOnVars(&mdbList, "composite");
 mdbObjRemoveHiddenVars(mdbList);
 
-#define FOUND_FILE_LIMIT 1000
+#define FOUND_FILE_LIMIT 2000
 int fileCount = 0;
 // Verify file existance and make fileList of those found
 struct fileDb *fileList = NULL, *oneFile = NULL; // Will contain found files
 struct mdbObj *mdbFiles = NULL; // Will caontain a list of mdbs for the found files
 while(mdbList && fileCount < FOUND_FILE_LIMIT)
     {
     boolean found = FALSE;
     struct mdbObj *mdbFile = slPopHead(&mdbList);
     char *composite = mdbObjFindValue(mdbFile,"composite");
     if (composite != NULL)
         {
         // First for FileName
         char *fileName = mdbObjFindValue(mdbFile,"fileName");
         if (fileName != NULL)
             {
             oneFile = fileDbGet(db, ENCODE_DCC_DOWNLOADS, composite, fileName);
             if (oneFile)
                 {
                 //warn("%s == %s",fileType,oneFile->fileType);
                 if (isEmpty(fileType) || sameWord(fileType,"Any")
                 || (oneFile->fileType && sameWord(fileType,oneFile->fileType)))
                     {
                     slAddHead(&fileList,oneFile);
                     oneFile->mdb = mdbFile;
                     slAddHead(&mdbFiles,mdbFile);
                     fileCount++;
                     found = TRUE;
-                    continue;
                     }
                 }
                 else
                     fileDbFree(&oneFile);
             }
         // Now for FileIndexes
         fileName = mdbObjFindValue(mdbFile,"fileIndex");
         if (fileName != NULL)
             {
            // Verify existance first
             oneFile = fileDbGet(db, ENCODE_DCC_DOWNLOADS, composite, fileName);
             if (oneFile)
                 {
                 //warn("%s == %s",fileType,oneFile->fileType);
                 if (isEmpty(fileType) || sameWord(fileType,"Any")