Ver Fonte

Use SHA1 hashes to encode file names in the timestamp directory.

This will cause all files to be publish again, once, to update
to the new structure.
Carsten Dominik há 17 anos atrás
pai
commit
869aa0d628
3 ficheiros alterados com 16 adições e 4 exclusões
  1. 9 0
      ORGWEBPAGE/Changes.org
  2. 5 0
      lisp/ChangeLog
  3. 2 4
      lisp/org-publish.el

+ 9 - 0
ORGWEBPAGE/Changes.org

@@ -16,6 +16,15 @@
 :END:
 
 ** Overview
+** Incompatible changes
+*** New structure for the timestamp directory for org-publish.
+    The timestamp directory now uses SHA1 hashed versions of the
+    path to each publishing file.  This should be a consistent
+    and system-independent way to handle things.  The change
+    means that your next publishing command will publish each and
+    every file again, but just once, until the timestamps are
+    updated.
+
 ** Details
 
 *** New parameters :prefix and :prefix1 for include files

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-07-07  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-publish.el (org-publish-timestamp-filename): Use
+	SHA1-encoded file names in the timestamp directory.
+
 2008-07-05  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-publish.el (org-publish-needed-p): Be verbose about files

+ 2 - 4
lisp/org-publish.el

@@ -297,10 +297,8 @@ If functions in this hook modify the buffer, it will be saved."
 
 (defun org-publish-timestamp-filename (filename)
   "Return path to timestamp file for filename FILENAME."
-  (while (string-match
-	  (if (eq system-type 'windows-nt) "~\\|/\\|:" "~\\|/") filename)
-    (setq filename (replace-match "_" nil t filename)))
-  (concat org-publish-timestamp-directory filename ".timestamp"))
+  (concat (file-name-as-direcory org-publish-timestamp-directory)
+         "X" (if (fboundp 'sha1) (sha1 filename) (md5 filename))))
 
 (defun org-publish-needed-p (filename)
   "Return `t' if FILENAME should be published."