src/hg/lib/jsHelper.c 1.29

1.29 2009/08/13 07:32:29 larrym
remove code in jsIncludeFile which dynamically creates the versioned softlinks (they have to be created via make install)
Index: src/hg/lib/jsHelper.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/jsHelper.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -b -B -U 4 -r1.28 -r1.29
--- src/hg/lib/jsHelper.c	8 Jul 2009 19:48:54 -0000	1.28
+++ src/hg/lib/jsHelper.c	13 Aug 2009 07:32:29 -0000	1.29
@@ -369,34 +369,17 @@
                 errAbort("jsIncludeFile: javascript file: %s doesn't exist.\n", dyStringContents(realFileName));
                 }
             mtime = fileModTime(dyStringContents(realFileName));
 
-            // we add mtime to create a pseudo-version; this forces browsers to reload js file when it changes,
-            // which fixes bugs and odd behavior that occurs when the browser caches modified js files
+            // We add mtime to create a pseudo-version; this forces browsers to reload js file when it changes,
+            // which fixes bugs and odd behavior that occurs when the browser caches modified js files.
+            // The versioned files are soft-links created by the js directory makefile
 
             dyStringPrintf(fileNameWithVersion, "%s-%ld.js", baseName, mtime);
             dyStringPrintf(fullNameWithVersion, "%s/%s", dyStringContents(fullDirName), dyStringContents(fileNameWithVersion));
             if(!fileExists(dyStringContents(fullNameWithVersion)))
                 {
-                // Make a new, versioned symlinks and delete any older versioned symlinks.
-                struct dyString *pattern = dyStringNew(0);
-                struct slName *files, *file;
-                dyStringPrintf(pattern, "%s-[0-9]+\\.js", baseName);
-                files = listDirRegEx(dyStringContents(fullDirName), dyStringContents(pattern), REG_EXTENDED);
-                for (file = files; file != NULL; file = file->next)
-                    {
-                    struct dyString *tmp = dyStringNew(0);
-                    dyStringPrintf(tmp, "%s/%s", dyStringContents(fullDirName), file->name);
-                    unlink(dyStringContents(tmp));
-                    dyStringFree(&tmp);
-                    }
-                slFreeList(&files);
-                dyStringFree(&pattern);
-                if(symlink(dyStringContents(realFileName), dyStringContents(fullNameWithVersion)))
-                    {
-                    errAbort("jsIncludeFile: symlink failed: errno: %d (%s); the directory '%s' must be writeable by user '%s'\n", 
-                             errno, strerror(errno), dyStringContents(fullDirName), getUser());
-                    }
+                errAbort("jsIncludeFile: versioned javascript file: %s doesn't exist.\n", dyStringContents(fullNameWithVersion));
                 }
             dyStringFree(&fullNameWithVersion);
             dyStringFree(&fullDirName);
             }