[Bash-completion-devel] Expect buffering fixes

Crestez Dan Leonard cdleonard at gmail.com
Sun Mar 7 17:18:51 UTC 2010


On Sun, 2010-02-28 at 23:24 +0100, Freddy Vulto wrote: 
> On 100226 00:49, Crestez Dan Leonard wrote:
> > I pushed a new attempt at this in the expect-fixes branch. It first
> > matches a random string then the new prompt as distinct stages. This
> > seems to avoid races. Link to code: http://alturl.com/tf7u
> > 
> > Please test this; it was broken before.
> 
> Hmm, still getting errors, e.g.:
> 
>     $ ./run completion/awk.exp --debug
>     Running ./completion/awk.exp ...
>     FAIL: Sync after INT at timeout
>     ...
> 
> File dbg.log contains this:
> 
> ---8<-------------------------------------------------------------------
> ...
> expect: does "sync361" (spawn_id exp9) match regular expression ".*sync361$"? yes^M
> expect: set expect_out(0,string) "sync361"^M
> expect: set expect_out(spawn_id) "exp9"^M
> expect: set expect_out(buffer) "sync361"^M
> send: sending "\u0019\u0003" to { exp9 }^M
> ^M
> expect: does "" (spawn_id exp9) match regular expression "^(\^C)?\r\n/@$"? no^M
> 1^H1^M
> expect: does "1\u00081" (spawn_id exp9) match regular expression "^(\^C)?\r\n/@$"? no^M
> ^M
> ^M
> expect: does "1\u00081\r\n" (spawn_id exp9) match regular expression "^(\^C)?\r\n/@$"? no^M
> /@^M
> expect: does "1\u00081\r\n/@" (spawn_id exp9) match regular expression "^(\^C)?\r\n/@$"? no^M
> expect: timed out^M
> FAIL: Sync after INT at timeout
> ...
> ---8<-------------------------------------------------------------------
> 
> Something fishy is going on: from "1^H1^M" it looks like an additional "1" is
> inserted, then backspaced ("^H") and then inserted again. At other FAILs this
> "1" character is always the last character of the random sync string...?
> 
> The problem goes away on bash-3 if I add a tiny `sleep' again just before
> sending QUIT/INT:
This is on bash 3.0? I can't get test to run properly on bash-3, not
even the master branch. And we just dropped support for it anyway.

---8<-------------------------------------------------------------------
Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file
for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for
target.
Using ./config/default.exp as tool-and-target-specific interface file.
ERROR Unexpected output from bash command "source "$BASH_COMPLETION"":
bash: /home/cdleonard/files/work/bash/bash-completion/bash_completion:
line 380: syntax error near unexpected token `${!OPTIND}'
bash: /home/cdleonard/files/work/bash/bash-completion/bash_completion:
line 380: `        varnames+=( ${!OPTIND} )'
ERROR executing bash command "source
"$BASH_COMPLETION""Running ./completion/a2ps.exp ...
Running ./completion/abook.exp ...
Running ./completion/acroread.exp ...
FAIL: Completion via _filedir_xspec() should be installed at prompt
FAIL: acroread fixtures/shared/default/ should show completions at
timeout
---8<-------------------------------------------------------------------





More information about the Bash-completion-devel mailing list