From 8c022e1b72957b681dc9dbc9786b6f5d132a8f92 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Mon, 27 Oct 2008 07:44:12 +0100 Subject: [PATCH] Fix lockfile/symlink problem in org-publish. Richard Riley and Sebastian Rose hunted down this bug. --- lisp/ChangeLog | 5 +++++ lisp/org-publish.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c87b2519..c20aba188 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-10-27 Carsten Dominik + + * org-publish.el (org-publish-get-base-files-1): Deal correctly + with broken symlinks + 2008-10-26 Carsten Dominik * org-exp.el (org-export-select-tags, org-get-current-options): diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 914e7f691..e0cf4bdb8 100644 --- a/lisp/org-publish.el +++ b/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))))