[Toybox] Heads up on the sed N behavior change.

enh enh at google.com
Tue Sep 13 14:25:00 PDT 2022


i'll keep an eye out, but since we _came_ from GNU sed, yeah, i'd be
surprised if we'd introduced any POSIX assumptions since then.

for now though any update is still blocked on the chattr test breakage from
SKIPNEXT...

-- chattr
/system/bin/sh: /data/local/tmp/toybox-tests/runtest.sh[222]: syntax error:
unexpected operator/operand '=~'
/system/bin/sh: can't create testFile: Operation not permitted
rm: testFile: Operation not permitted
PASS: chattr immutable
/system/bin/sh: can't create testFile: Operation not permitted
PASS: chattr append-only
PASS: chattr toggle A
PASS: chattr toggle d
FAIL: chattr toggle e
echo -ne '' | lsattr testFile | awk '{print $1}' > attrs;
    grep -q e attrs || cat attrs; cat testFile && chattr -e testFile &&
    lsattr testFile | clean; rm -rf testFile
--- expected 2022-09-10 02:15:53.519998810 +0000
+++ actual 2022-09-10 02:15:53.559998809 +0000
@@ -1,2 +1,3 @@
+---------E----------
 abcdefghijklmnopqrstuvwxyz
 -------------------- testFile


On Tue, Sep 13, 2022 at 9:37 AM Rob Landley <rob at landley.net> wrote:

> There's a tiny possibility
> https://github.com/landley/toybox/commit/1724b3589a50
> will break the AOSP build if you've been using nothing but toybox sed for
> years,
> and people writing sed scripts have actually read posix.
>
> That said, if Red Hat 9 from 2003 wasn't following Posix and Debian still
> isn't
> today, then the posix behavior ain't what Linux does.
>
> I pulled a couple other tweaks to that effect from the todo heap (Posix
> EXPLICITLY says that "l" should not escape \n and yet Linux does), but
> mostly
> because I'm going through making sure -z is always NUL instead of \n in
> hold
> space aggregation and so on (\0 is escaped as \000 because they left it as
> "unknown character below 32 gets 3 digit octal escape" which I suppose
> makes
> sense because otherwise \0 followed by actual digits is ambiguous), and I
> don't
> expect those to cause a problem with real scripts? (Yeah famous last
> words...)
>
> Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20220913/be44872c/attachment.htm>


More information about the Toybox mailing list