[Toybox] [PATCH] Support diff --no-dereference

enh enh at google.com
Wed Sep 4 11:53:02 PDT 2024


thanks (and hope you're feeling better soon)!

unfortunately this breaks the toybox tests when run with a toybox
userspace. specifically:

FAIL: cat - file1
echo -ne 'hello\n' | cat - file1 | diff -a -U 0 - file1 | tail -n 1
--- expected 2024-09-04 15:42:17.810574434 +0000
+++ actual 2024-09-04 15:42:17.830574434 +0000
@@ -1 +1 @@
--hello
+File - is a symbolic link while file file1 is a regular file

FAIL: split reassembly
echo -ne '' | ls whang* | sort | xargs cat > reassembled && seq 1
20000 | diff -u reassembled - && echo yes
--- expected 2024-09-04 15:44:48.458578281 +0000
+++ actual 2024-09-04 15:44:48.498578282 +0000
@@ -1 +1 @@
-yes
+File reassembled is a regular file while file - is a symbolic link

i guess the

    if ((i = S_ISREG(TT.st[0].st_mode)) != S_ISREG(TT.st[1].st_mode)) {
      char *fidir[] = {"regular file", "symbolic link"};
      printf("File %s is a %s while file %s is a %s\n",
        files[0], fidir[!i], files[1], fidir[i]);
      TT.differ = 1;
    } else {

behavior isn't the diffutils default?


On Wed, Sep 4, 2024 at 3:06 AM Rob Landley <rob at landley.net> wrote:
>
> On 9/3/24 07:02, enh wrote:
> > ping again on this patch... it's wanted for kernel builds.
>
> Applied, sorry. (With a subsequent fixup patch for my main gripe.)
>
> I went from preparing for my Tokyo flight to a typhoon that got held up in
> customs (maybe it tried to bring fruit) to "the incubation period of the
> flight's up, let's see what I rolled this time" which was...
>
> https://mstdn.jp/@landley/113077247026969263
>
> Still not really back to form...
>
> Rob


More information about the Toybox mailing list