[Orgmode] Re: [Patch] Bug: Inconsistency with org-publish-attachment

2010-09-17 Thread Aidan Gauland
Sebastian Rose sebastian_rose at gmx.de writes:
 did you revert the previous patch?  The second patch was against master
 again.

I ran git reset --hard then applied the second patch.

 I changed to a subdirectory of my :base-directory (here $BASE):

 $ cd ${BASE}/subdirectory
 $ cp ~/images/first.jpg .# a simple image
 $ ln -s ~/images/second.jpg  # a link to an image
 $ ln -s ~/images/screenshots/# a link to a directory

 When exporting, I get this tree in :publishing-directory ($PUB):

 $PUB/
  |-- subdirectory/
  |   |-- first.jpg
  |   |-- second.jpg
  |   `-- screenshots/
  |   |-- some.png
  |   `-- other.png

 which is what you expected, is that right?

Yes, that's what I expected.  What I'm getting is a little different.

$PUB/
`-- subdirectory/
|-- screenshots/
| `-- subdirectory/
| `-- screenshots/
| |-- other.png
| `-- some.png
`-- subdirectory/
|-- first.jpg
|-- second.jpg

This is how the project is defined...
(setq 
 org-publish-project-alist
 '((static
:base-directory ~/org-bug/
:publishing-directory ~/org-bug-pub/
:publishing-function org-publish-attachment
:recursive t
:base-extension css\\|gz\\|bz\\|lzma\\|jpg\\|gif\\|png)))

And published with this sexp.
(org-publish static)

Perhaps the discrepancy between our setups is git commit (not sure if
I'm using the right terms there)?  git log shows
878d94b47225729bfffaca9c57a5bdeb344a8ffb at the top of its output.

Thanks for your help!
--Aidan



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [Patch] Bug: Inconsistency with org-publish-attachment

2010-09-17 Thread Sebastian Rose
Aidan Gauland aidal...@no8wireless.co.nz writes:
 Sebastian Rose sebastian_rose at gmx.de writes:
 did you revert the previous patch?  The second patch was against master
 again.

 I ran git reset --hard then applied the second patch.

 I changed to a subdirectory of my :base-directory (here $BASE):

 $ cd ${BASE}/subdirectory
 $ cp ~/images/first.jpg .# a simple image
 $ ln -s ~/images/second.jpg  # a link to an image
 $ ln -s ~/images/screenshots/# a link to a directory

 When exporting, I get this tree in :publishing-directory ($PUB):

 $PUB/
  |-- subdirectory/
  |   |-- first.jpg
  |   |-- second.jpg
  |   `-- screenshots/
  |   |-- some.png
  |   `-- other.png

 which is what you expected, is that right?

 Yes, that's what I expected.  What I'm getting is a little different.

 $PUB/
 `-- subdirectory/
 |-- screenshots/
 |   `-- subdirectory/
 |   `-- screenshots/
 |   |-- other.png
 |   `-- some.png
 `-- subdirectory/
 |-- first.jpg
 |-- second.jpg

 This is how the project is defined...
 (setq 
  org-publish-project-alist
  '((static
 :base-directory ~/org-bug/
 :publishing-directory ~/org-bug-pub/
 :publishing-function org-publish-attachment
 :recursive t
 :base-extension css\\|gz\\|bz\\|lzma\\|jpg\\|gif\\|png)))

 And published with this sexp.
 (org-publish static)

 Perhaps the discrepancy between our setups is git commit (not sure if
 I'm using the right terms there)?  git log shows
 878d94b47225729bfffaca9c57a5bdeb344a8ffb at the top of its output.

 Thanks for your help!
 --Aidan


Ahrrgh :)

I just pulled, because I couldn't find that commit.

That commit already includes the (obviously wrong) first patch...


Here's the patch that reverts the first attempt and applies the new
one.   Hope this works :)



  Sebastian


diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index 7534524..90b0339 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -578,18 +578,13 @@ See `org-publish-org-to' to the list of arguments.
   Publish a file with no transformation of any kind.
 See `org-publish-org-to' to the list of arguments.
   ;; make sure eshell/cp code is loaded
-  (let* ((rel-dir
-	  (file-relative-name
-	   (file-name-directory filename)
-	   (plist-get plist :base-directory)))
-	 (pub-dir
-	  (expand-file-name
-	   (concat (file-name-as-directory pub-dir) rel-dir
 (unless (file-directory-p pub-dir)
   (make-directory pub-dir t))
 (or (equal (expand-file-name (file-name-directory filename))
 	   (file-name-as-directory (expand-file-name pub-dir)))
-	(copy-file filename pub-dir t
+  (copy-file filename
+		 (expand-file-name (file-name-nondirectory filename) pub-dir)
+		 t)))
 
 
 ;;; Publishing files, sets of files, and indices
@@ -606,13 +601,13 @@ See `org-publish-projects'.
 		  (error File %s not part of any known project
 			 (abbreviate-file-name filename)
 	 (project-plist (cdr project))
-	 (ftname (file-truename filename))
+	 (ftname (expand-file-name filename))
 	 (publishing-function
 	  (or (plist-get project-plist :publishing-function)
 	  'org-publish-org-to-html))
 	 (base-dir
 	  (file-name-as-directory
-	   (file-truename
+	   (expand-file-name
 	(or (plist-get project-plist :base-directory)
 		(error Project %s does not have :base-directory defined
 		   (car project))
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [Patch] Bug: Inconsistency with org-publish-attachment

2010-09-17 Thread Aidan Gauland
On Sat, Sep 18, 2010 at 12:18:42AM +0200, Sebastian Rose wrote:
 That commit already includes the (obviously wrong) first patch...
 
 Here's the patch that reverts the first attempt and applies the new
 one.   Hope this works :)

Yup, this one works!  Bug squashed.  Go ahead and commit it.

Thanks again,
Aidan


signature.asc
Description: Digital signature
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [Patch] Bug: Inconsistency with org-publish-attachment

2010-09-17 Thread Sebastian Rose
Aidan Gauland aidal...@no8wireless.co.nz writes:
 On Sat, Sep 18, 2010 at 12:18:42AM +0200, Sebastian Rose wrote:
 That commit already includes the (obviously wrong) first patch...
 
 Here's the patch that reverts the first attempt and applies the new
 one.   Hope this works :)

 Yup, this one works!  Bug squashed.  Go ahead and commit it.

 Thanks again,
 Aidan


Yiiihaa!  Thanks for testing!


Best wishes

   Sebastian

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode