• a naive question about EOL encoding in Debian

    From Patrice Duroux@21:1/5 to All on Sat Mar 18 21:10:01 2023
    XPost: linux.debian.devel.qa

    Hi,

    I am facing ^M (\r) character in the .build output file using sbuild
    on my system (Sid).
    For instance:

    $ file timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build: ASCII text, with
    very long lines (307), with CRLF, CR, LF line terminators

    It seems to me that there are some tools not using the conventional
    unix EOL (\n only) in formating their output.
    So I was curious if there are:
    1. a policy on this (and more generally source file and/or output encoding),
    2. a way to search using Debian Code Search for possible culprits,
    just to get an idea.
    ;-)

    Many thanks,
    Patrice

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrey Rakhmatullin@21:1/5 to Patrice Duroux on Sun Mar 19 00:30:01 2023
    XPost: linux.debian.devel.qa

    On Sat, Mar 18, 2023 at 08:45:37PM +0100, Patrice Duroux wrote:
    Hi,

    I am facing ^M (\r) character in the .build output file using sbuild
    on my system (Sid).
    For instance:

    $ file timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build: ASCII text, with
    very long lines (307), with CRLF, CR, LF line terminators

    It seems to me that there are some tools not using the conventional
    unix EOL (\n only) in formating their output.
    Such as?
    That file(1) output, as often happens with file(1) output, is not very
    useful or trustworthy by itself.

    So I was curious if there are:
    1. a policy on this (and more generally source file and/or output encoding),
    There is a difference between printing something on stdout and actually
    writing files. Printing should of course be in the user locale while files
    are different, especially non-text ones.

    2. a way to search using Debian Code Search for possible culprits,
    just to get an idea.
    I doubt that.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon McVittie@21:1/5 to Patrice Duroux on Sun Mar 19 11:30:01 2023
    On Sat, 18 Mar 2023 at 20:45:37 +0100, Patrice Duroux wrote:
    I am facing ^M (\r) character in the .build output file using sbuild
    on my system (Sid).
    For instance:

    $ file timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build timidity_2.14.0-9_amd64-2023-03-18T18:33:37Z.build: ASCII text, with
    very long lines (307), with CRLF, CR, LF line terminators

    This is often caused by capturing output from a pseudo-terminal (pty)
    like script(1) does. Unix text files conventionally use \n line endings,
    and programs conventionally output \n, but Unix terminals must translate
    this into \r\n, otherwise the output will show a "staircase" effect
    where the cursor doesn't return to column 0 on new lines.

    In the case of sbuild logs, all the \r usually come from apt
    installing the build-dependencies, which works by capturing text from
    a pseudo-terminal.

    smcv

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)