From mboxrd@z Thu Jan 1 00:00:00 1970 From: tftorrey@tftorrey.com (T.F. Torrey) Subject: [PATCH] Fix for relative symlinks in subdirectories Date: Sun, 02 Sep 2012 11:44:43 -0700 Message-ID: <87mx18fen8.fsf@lapcat.tftorrey.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8FQ2-0008Fs-4u for emacs-orgmode@gnu.org; Sun, 02 Sep 2012 15:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8FQ0-0003Oi-Us for emacs-orgmode@gnu.org; Sun, 02 Sep 2012 15:01:14 -0400 Received: from slow3-v.mail.gandi.net ([217.70.178.89]:51791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8FQ0-0003Lw-O1 for emacs-orgmode@gnu.org; Sun, 02 Sep 2012 15:01:12 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by slow3-v.mail.gandi.net (Postfix) with ESMTP id 85A5686886 for ; Sun, 2 Sep 2012 20:45:06 +0200 (CEST) Received: from mfilter6-d.gandi.net (mfilter6-d.gandi.net [217.70.178.135]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 82518A807E for ; Sun, 2 Sep 2012 20:45:04 +0200 (CEST) Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter6-d.gandi.net (mfilter6-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id 330JfXcYqt6A for ; Sun, 2 Sep 2012 20:45:03 +0200 (CEST) Received: from lapcat.tftorrey.com.tftorrey.com (fat-69-171-172-11.evdo.leapwireless.net [69.171.172.11]) (Authenticated sender: tftorrey@tftorrey.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 59B21A804E for ; Sun, 2 Sep 2012 20:45:01 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello all, When publishing a project that contains relative symlinks in subdirectories, org-publish-cache-ctime-of-src mistakenly connects the true file name with the base-dir of the project instead of the symlink, causing an error when the linked file is in a subdirectory and not the base-dir. The attached patch modifiies org-publish-cache-ctime-of-src to use the dir of the current file as the base-dir instead of simply the project base-dir. With this change, though, the base-dir argument to this function now never does anything. This doesn't seem to cause problems for me, but I am far from intimate with the workings of the org-publish cache system. Perhaps someone with better knowledge of the system could provide a better fix. Otherwise, the base-dir argument could be refactored out. ChangeLog entry: Fix for relative symlinks in subdirectories Modify org-publish-cache-ctime-of-src to use the dir of the current file as the base-dir instead of simply the project base-dir. TINYCHANGE Emacs : GNU Emacs 24.2.50.1 (i686-pc-linux-gnu, GTK+ Version 3.4.2) of 2012-08-29 on nannyberry, modified by Debian Package: Org-mode version 7.9 (release_7.9-190-g845daf.dirty-git @ mixed installation! /usr/local/share/emacs/site-lisp/ and /home/tftorrey/.emacs.d/src/org-mode/lisp/) Best regards, Terry -- T.F. Torrey --=-=-= Content-Type: text/plain Content-Disposition: inline Content-Description: Patch for org-publish.el diff --git a/lisp/org-publish.el b/lisp/org-publish.el index e78e2d4..cd77c82 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -1191,7 +1191,7 @@ Returns value on success, else nil." (defun org-publish-cache-ctime-of-src (f base-dir) "Get the FILENAME ctime as an integer." (let ((attr (file-attributes - (expand-file-name (or (file-symlink-p f) f) base-dir)))) + (expand-file-name (or (file-symlink-p f) f) (file-name-directory f))))) (+ (lsh (car (nth 5 attr)) 16) (cadr (nth 5 attr))))) --=-=-=--