Author Topic: diff --strip-trailing-cr  (Read 544 times)

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
diff --strip-trailing-cr
« on: July 17, 2017, 11:18:56 am »
Now, that I build most of recent TexLive, I'm running the tests. I notice that diffs are failing because the ground truth have LF/CR, but the generated test files don't.
For now, I have added -w to the test scripts, but I noticed that the correct parameter --strip-trailing-cr is deactivated on OS/2.
Does someone know the rationale behind that? Does it really makes sense to forbid this option?



André Heldoorn

  • Sr. Member
  • ****
  • Thank You
  • -Given: 46
  • -Receive: 9
  • Posts: 276
    • View Profile
Re: diff --strip-trailing-cr
« Reply #1 on: July 17, 2017, 03:29:51 pm »
Does it really makes sense to forbid this option?

Would an OS/2 user, i.e. not a developer using COMP or DIFF for testing purposes, ever use the option?

If an user of Linux wants to check your LF/CR output, has Unix a --add-cr option to add a CR to their output?

Just wondering, I'm not expecting answers. It's an option, with the freedom of choice to not use it.

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #2 on: July 17, 2017, 03:41:38 pm »
That's the problem, diff --help states and my test this morning suggests, that this option is always off, so there is no choice.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 94
  • Posts: 1125
    • View Profile
Re: diff --strip-trailing-cr
« Reply #3 on: July 17, 2017, 06:58:10 pm »
I've never used --strip-trailing-cr and have looked at the diff patch that Netlabs applied, same as I did to get stdin working. Possibly it was disabled and committed a long time ago, lots of OS/2 ifdefs in the source IIRC.
I usually use the --binary option to avoid having CR to begin with. And occasionally have had to manually strip the CRs out, usually when a patch was emailed.

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #4 on: July 17, 2017, 11:14:38 pm »
Yeah, but the thing is, I'm talking about generated files that are tested against some ground truth files. I have not much choice here.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 8
  • -Receive: 94
  • Posts: 1125
    • View Profile
Re: diff --strip-trailing-cr
« Reply #5 on: July 18, 2017, 12:47:02 am »
Looks like someone got lazy with our port. From diff --help
Code: [Select]
      --strip-trailing-cr         strip trailing carriage return on input
                                    [always unset on OS/2]
      --binary                    read and write data in binary mode
                                    [always set on OS/2]

which doesn't exist in a source tarball I have here. Options include a different version of diff or changing the ground truth files to have DOS line endings

Rich Walsh

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 4
  • Posts: 40
    • View Profile
Re: diff --strip-trailing-cr
« Reply #6 on: July 18, 2017, 04:34:28 am »
Looks like someone got lazy with our port.

Actually, it sounds like a certain individual put his own needs and preferences above those of the users, yet again...

Attached is a version of diff built using EMX that may be old but isn't crippled...
« Last Edit: July 18, 2017, 04:39:06 am by Rich Walsh »

Mike La Martina

  • Jr. Member
  • **
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 52
    • View Profile
Re: diff --strip-trailing-cr
« Reply #7 on: July 18, 2017, 05:12:59 am »
Thanks Rich for the diff utility.
Jochen do you plan to make a distribution of TexLive for ArcaOS?  I am a Tex user and currently use VTex which works well, but as you know is rather old.

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #8 on: July 18, 2017, 08:36:40 am »
That's the plan ;-)

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #9 on: July 18, 2017, 08:38:51 am »
Thanks Rich for the diff utility.
Jochen do you plan to make a distribution of TexLive for ArcaOS?  I am a Tex user and currently use VTex which works well, but as you know is rather old.
Thanks for the diff. I will file a ticket against diffutils.

Andreas Schnellbacher

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 232
    • View Profile
Re: diff --strip-trailing-cr
« Reply #10 on: July 18, 2017, 03:42:24 pm »

guzzi

  • Sr. Member
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 12
  • Posts: 253
    • View Profile
Re: diff --strip-trailing-cr
« Reply #11 on: July 18, 2017, 10:47:23 pm »
Is this perhaps the problem? http://trac.netlabs.org/ports/ticket/22

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #12 on: July 18, 2017, 11:14:14 pm »
That's the problem.

Jochen Schäfer

  • Jr. Member
  • **
  • Thank You
  • -Given: 11
  • -Receive: 7
  • Posts: 86
    • View Profile
Re: diff --strip-trailing-cr
« Reply #13 on: July 19, 2017, 08:28:53 am »
Looks like someone got lazy with our port.

Actually, it sounds like a certain individual put his own needs and preferences above those of the users, yet again...

Attached is a version of diff built using EMX that may be old but isn't crippled...
Thanks. This diff version does the trick.

Alex Taylor

  • Full Member
  • ***
  • Thank You
  • -Given: 10
  • -Receive: 15
  • Posts: 215
    • View Profile
Re: diff --strip-trailing-cr
« Reply #14 on: July 19, 2017, 06:01:11 pm »
That's the plan ;-)

Do you have the current TexLive building? How much of it? I'd be very happy to see XeTeX working, for example... :)