From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Fleury Subject: Re: [PATCH] ob-shell Date: Fri, 22 Aug 2014 15:08:35 +0200 Message-ID: References: <86vbsycepz.fsf@somewhere.org> <87tx8iks22.fsf@bzg.ath.cx> <86ppi6qnb5.fsf@somewhere.org> <87vbrxx4zr.fsf@Rainer.invalid> <86ppi5uwgl.fsf@somewhere.org> <877g4cacn9.fsf@Rainer.invalid> <87vbrt8hpo.fsf_-_@Rainer.invalid> <87ha3ck9as.fsf@gmail.com> <87bns0gho2.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c1e856e475d50501378a57 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKoad-0007FG-8l for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 09:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKoab-00060k-Jm for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 09:09:11 -0400 Received: from mail-ie0-x233.google.com ([2607:f8b0:4001:c03::233]:56770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKoab-00060W-CF for emacs-orgmode@gnu.org; Fri, 22 Aug 2014 09:09:09 -0400 Received: by mail-ie0-f179.google.com with SMTP id rl12so6498460iec.10 for ; Fri, 22 Aug 2014 06:09:08 -0700 (PDT) In-Reply-To: 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: Alan Schmitt Cc: Achim Gratz , emacs-org list --001a11c1e856e475d50501378a57 Content-Type: multipart/alternative; boundary=001a11c1e856e475d00501378a55 --001a11c1e856e475d00501378a55 Content-Type: text/plain; charset=UTF-8 Me again, Please forget about the previous patch I submitted, I have a new one that should work now on all platforms. Let me know if it should be formatted differently. I will also add some more tests to check that such arrays in bash are handled properly when the input contains whitespace, quotes, commas and other chars that one may have to deal with. --paf On Fri, Aug 22, 2014 at 10:52 AM, Pascal Fleury wrote: > Hello, > > I have a little patch (attached) that does check the version of bash, and > uses associative arrays (or doesn't) depending on that version. > > The problem now is that the test suite will only work on one platform t a > time, i.e. if there is a bash4 there, it will pass, but if it has bash3, it > will work as intended, but return a different value set. Is there a way to > have platform-dependent tests ? > > --Pascal > > > > On Wed, Aug 13, 2014 at 3:29 PM, Alan Schmitt < > alan.schmitt@polytechnique.org> wrote: > >> On 2014-08-13 15:20, Pascal Fleury writes: >> >> > Yes, sorry for late reaction (it's holiday season here :-). >> >> Funny, it's holiday season here as well (in Bretagne) ;-) >> >> > This is an issue I introduced with the assoc. arrays, which does not >> > verify if the installed version of bash handles them (from bash4 on). >> > It needs a modification in the setup code that checks the version and >> > only issues assoc. array code when bash supports it. And it so happens >> > that Macs have bash3 installed. Will try to find such a machine and >> > add the test. >> >> Thanks a lot. If I can help, please let me know. >> >> Best, >> >> Alan >> >> -- >> OpenPGP Key ID : 040D0A3B4ED2E5C7 >> > > > > -- > --paf > -- --paf --001a11c1e856e475d00501378a55 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Me again,

Please forget about the previ= ous patch I submitted, I have a new one that should work now on all platfor= ms.
Let me know if it should be formatted differently.

I will also add some more tests to check that such arrays in= bash are handled properly when the input contains whitespace, quotes, comm= as and other chars that one may have to deal with.

--paf



On Fri, Aug 22, 2014 at 10:52 AM, Pascal Fleury <f= leury@google.com> wrote:
Hello,

I= have a little patch (attached) that does check the version of bash, and us= es associative arrays (or doesn't) depending on that version.

The problem now is that the test suite will only work o= n one platform t a time, i.e. if there is a bash4 there, it will pass, but = if it has bash3, it will work as intended, but return a different value set= . Is there a way to have platform-dependent tests ?

--Pascal




--
--paf
--001a11c1e856e475d00501378a55-- --001a11c1e856e475d50501378a57 Content-Type: application/octet-stream; name="0001-ob-shell.el-now-emits-associative-array-code-only-wh.patch" Content-Disposition: attachment; filename="0001-ob-shell.el-now-emits-associative-array-code-only-wh.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hz5jaeeq1 RnJvbSAyNTE1NjZiMDdkNzVlMDI1NGY1MDQ0YjM4MDdjYjlkMGVhOWZmNzQ5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXNjYWwgRmxldXJ5IDxmbGV1cnlAZ29vZ2xlLmNvbT4KRGF0 ZTogRnJpLCAyMiBBdWcgMjAxNCAxNTowNDowMCArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIG9iLXNo ZWxsLmVsIG5vdyBlbWl0cyBhc3NvY2lhdGl2ZSBhcnJheSBjb2RlIG9ubHkgd2hlbiB0aGUKIGlu c3RhbGxlZCB2ZXJzaW9uIG9mIGJhc2ggc3VwcG9ydHMgdGhlbS4gVGhpcyB0YWtlcyBjYXJlIG9m IGRpZmZlcmVuY2VzIGluCiBwbGF0Zm9ybXMgdGhhdCBzaGlwIHdpdGggYmFzaCB2NCssIHRoYXQg Y2FuIGRlYWwgd2l0aCB0aGVtLCBhbmQgdGhvc2UgKGUuZy4KIE1hY09TWCkgdGhhdCBzaGlwIHdp dGggYmFzaCB2My54IHRoYXQgZG9lcyBub3Qgc3VwcG9ydCBzdWNoIGFycmF5cy4KCi0tLQogbGlz cC9vYi1zaGVsbC5lbCAgICAgICAgICAgICAgICAgICB8IDEyICsrKysrKysrKy0tLQogdGVzdGlu Zy9leGFtcGxlcy9vYi1zaGVsbC10ZXN0Lm9yZyB8ICA4ICsrKysrKystCiB0ZXN0aW5nL2xpc3Av dGVzdC1vYi1zaGVsbC5lbCAgICAgIHwgIDIgKy0KIDMgZmlsZXMgY2hhbmdlZCwgMTcgaW5zZXJ0 aW9ucygrKSwgNSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9saXNwL29iLXNoZWxsLmVsIGIv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