Libelektra: shell recorder: EOF broken

Created on 28 Oct 2017  路  8Comments  路  Source: ElektraInitiative/libelektra

Describe what you wanted to do

Run unit tests.

Describe what you expected

That all unit tests are successful.

Describe what actually happened

        134 - testshell_markdown_kdb-global-umount (Failed)
        142 - testshell_markdown_ini (Failed)
        147 - testshell_markdown_multifile (Failed)
        152 - testshell_markdown_tutorial_validation (Failed)
        153 - testshell_markdown_base64 (Failed

It seems like EOF is broken, maybe due to \n handling? (sorry the errors are partly german):

CMD: cat > `kdb file /examples/ini` <<EOF \n[Section1]\nkey1 = val1\n[Section3]\nkey3 = val3\nEOF\n
RET: 1
=== FAILED return value doesn't match expected pattern 0
STDERR: sh: Warnung: Das in der Zeile 0 beginnende Here-Dokument geht bis zum Dateiende (erwartet wird `EOF').
Using name user/examples/ini
cat: 'n[Section1]nkey1': Datei oder Verzeichnis nicht gefunden
cat: '=': Datei oder Verzeichnis nicht gefunden
cat: 'val1n[Section3]nkey3': Datei oder Verzeichnis nicht gefunden
cat: '=': Datei oder Verzeichnis nicht gefunden
cat: val3nEOFn: Datei oder Verzeichnis nicht gefunden
STDOUT: 
WARNINGS: 
ERRORS: 
DIFF: 

System Information

  • Elektra Version: master

Further Log Files and Output

bug low priority

Most helpful comment

btw. it is GNU bash, Version 4.4.12(1)-release (x86_64-pc-linux-gnu)

That information was quite helpful. I can reproduce the problem now.

All 8 comments

Sorry for the late response. If I configure Elektra with the standard options on macOS, then the only test that fails is testshell_markdown_tcl. This is the case since the plugin depends on base64, which is still marked as experimental. (It might make sense to either remove the experimental tag from base64 or add it to tcl.)

All the other Markdown Shell Recorder tests, that include all tests you mentioned above (except for testshell_markdown_base64), work fine. The tests also work on Debian unstable.

Okay, I found the problem: It does not work if /bin/sh points to bash. In a fresh installation it is now /bin/dash by default, but if you upgraded Debian since a long time it might be still /bin/bash. It is lower priority now though.

You are right about retagging experimental. Is base64 ready to be released as non-experimental?

Is base64 ready to be released as non-experimental?

I would say yes. I am not the author of the plugin though.

It does not work if /bin/sh points to bash.

That is very strange since sh also points to bash on macOS. Anyway, I will take a look at #1640 again. Hopefully the pull request will fix the problem.

btw. it is GNU bash, Version 4.4.12(1)-release (x86_64-pc-linux-gnu)

btw. it is GNU bash, Version 4.4.12(1)-release (x86_64-pc-linux-gnu)

That information was quite helpful. I can reproduce the problem now.

Btw. it would be great if the shell recorder itself (and not the tutorials) implements such quirks to satisfy individual shell implementations.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markus2330 picture markus2330  路  4Comments

mpranj picture mpranj  路  3Comments

sanssecours picture sanssecours  路  4Comments

sanssecours picture sanssecours  路  3Comments

mpranj picture mpranj  路  4Comments