[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Erroneous "No such file or directory" with babel and remote dir
From: |
Nick Dokos |
Subject: |
Re: [O] Erroneous "No such file or directory" with babel and remote dir |
Date: |
Wed, 26 Sep 2012 14:38:44 -0400 |
Achim Gratz <address@hidden> wrote:
> Loris Bennett writes:
> >> Can you try to bisect and find the bad commit (or a set of
> >> suspicious ones)?
> >
> > 552b0edb254a104e441e28f3a942dc6005e97f87 is the first bad commit
> > commit 552b0edb254a104e441e28f3a942dc6005e97f87
> > Author: Bastien Guerry <address@hidden>
> > Date: Sat Mar 17 15:44:41 2012 +0100
>
> This is not the commit you're looking for...
>
> Please "skip" these commits after starting the bisect by doing
>
> git bisect skip 7e903acccd..df82832fb7
>
> If the offending change is inside that range we can still deal with it
> later.
>
>
I sent mail to Eric with some partial findings about this, but I guess I
should have sent it to the list as well. Here is what I sent to Eric
(slightly edited by adding a few commas):
--8<---------------cut here---------------start------------->8---
Eric,
I went back to the above problem (see
http://thread.gmane.org/gmane.emacs.orgmode/57152/focus=60469 and the
associated thread) and I think I have taken it a bit further.
5cb80c7e5b9bca introduced the following bit of code at the end of
org-babel-sh-evaluate:
,----
| ('otherwise ; external shell script
| - (org-babel-eval org-babel-sh-command (org-babel-trim body))))))
| + (if (cdr (assoc :shebang params))
| + (let ((script-file (org-babel-temp-file "sh-script-"))
| + (shebang (cdr (assoc :shebang params)))
| + (padline (not (string= "no" (cdr (assoc :padline params))))))
| + (with-temp-file script-file
| + (when shebang (insert (concat shebang "\n")))
| + (when padline (insert "\n"))
| + (insert body))
| + (set-file-modes script-file #o755)
| + (org-babel-eval script-file ""))
| + (org-babel-eval org-babel-sh-command (org-babel-trim body)))))))
`----
So before, there was no if and we went straight into the org-babel-eval.
Now, the ``if'' seems to succeed all the time: the (cdr ..) returns "" with
Loris's example and (org-babel-eval script-file "") returns nil.
If I modify the condition so that it takes the false path and executes
the (org-babel-eval org-babel-sh-command (org-babel-trim body)) form,
it works.
I have no idea if this is correct - but it does seem to me that in this
particular case, it's taking the wrong branch: in particular, if no
shebang is specified, it should go the way it used to before this
change. Of course, there is also the problem of specifying a
shebang *and* a remote dir which is not handled correctly by this
modification.
For the record, the change I made was:
- (if (cdr (assoc :shebang params))
+ (if (not (string= (cdr (assoc :shebang params)) ""))
It's at the very least incomplete and it may be wrong, but I thought
I'd let you know.
--8<---------------cut here---------------end--------------->8---
HTH,
Nick
- [O] Erroneous "No such file or directory" with babel and remote dir, Loris Bennett, 2012/09/10
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Loris Bennett, 2012/09/26
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Achim Gratz, 2012/09/26
- Re: [O] Erroneous "No such file or directory" with babel and remote dir,
Nick Dokos <=
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Loris Bennett, 2012/09/26
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Achim Gratz, 2012/09/26
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Loris Bennett, 2012/09/27
- Re: [O] Erroneous "No such file or directory" with babel and remote dir, Achim Gratz, 2012/09/27