emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Achim Gratz <Stromeko@nexgo.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: Erroneous "No such file or directory" with babel and remote dir
Date: Wed, 26 Sep 2012 14:38:44 -0400	[thread overview]
Message-ID: <3059.1348684724@alphaville> (raw)
In-Reply-To: Message from Achim Gratz <Stromeko@nexgo.de> of "Wed, 26 Sep 2012 20:09:54 +0200." <878vbwhczx.fsf@Rainer.invalid>

Achim Gratz <Stromeko@nexgo.de> 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 <bzg@altern.org>
> > 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

  reply	other threads:[~2012-09-26 18:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10 14:36 Erroneous "No such file or directory" with babel and remote dir Loris Bennett
2012-09-10 14:42 ` Loris Bennett
2012-09-19  7:37 ` Bastien
2012-09-25 14:11   ` Loris Bennett
2012-09-25 15:30     ` Memnon Anon
2012-09-25 19:54     ` Achim Gratz
2012-09-26  6:56       ` Loris Bennett
2012-09-26  7:14         ` Bastien
2012-09-26 12:10   ` Loris Bennett
2012-09-26 18:09     ` Achim Gratz
2012-09-26 18:38       ` Nick Dokos [this message]
2012-09-26 18:57       ` Loris Bennett
2012-09-26 20:06         ` Achim Gratz
2012-09-27  6:38           ` Loris Bennett
2012-09-27 17:22             ` Achim Gratz
2012-11-13 15:16               ` Loris Bennett
2012-11-14  5:04                 ` Nick Dokos
2012-11-14  6:23                   ` Nick Dokos
2012-11-14  7:48                     ` Loris Bennett
2012-11-14 19:47                     ` Nick Dokos
2012-11-15  6:55                     ` Nick Dokos
2012-11-15 18:31                       ` Achim Gratz
2012-11-14  7:28                   ` Loris Bennett
2012-11-13 15:39               ` Loris Bennett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3059.1348684724@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).