Parcourir la source

Fix lockfile/symlink problem in org-publish.

Richard Riley and Sebastian Rose hunted down this bug.
Carsten Dominik il y a 16 ans
Parent
commit
8c022e1b72
2 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 5 0
      lisp/ChangeLog
  2. 2 1
      lisp/org-publish.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-10-27  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-publish.el (org-publish-get-base-files-1): Deal correctly
+	with broken symlinks
+
 2008-10-26  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org-exp.el (org-export-select-tags, org-get-current-options):

+ 2 - 1
lisp/org-publish.el

@@ -427,7 +427,7 @@ MATCH.  If SKIP-FILE is non-nil, skip file matching the regexp
 SKIP-FILE.  If SKIP-DIR is non-nil, don't check directories
 matching the regexp SKIP-DIR when recursiing through BASE-DIR."
   (mapc (lambda (f)
-	  (let ((fd-p (car (file-attributes f)))
+	  (let ((fd-p (file-directory-p f))
 		(fnd (file-name-nondirectory f)))
 	    (if (and fd-p recurse
 		     (not (string-match "^\\.+$" fnd))
@@ -435,6 +435,7 @@ matching the regexp SKIP-DIR when recursiing through BASE-DIR."
 		(org-publish-get-base-files-1 f recurse match skip-file skip-dir)
 	      (unless (or fd-p ;; this is a directory
 			  (and skip-file (string-match skip-file fnd))
+			  (not (file-exists-p (file-truename f)))
 			  (not (string-match match fnd)))
 		(pushnew f org-publish-temp-files)))))
 	(directory-files base-dir t (unless recurse match))))