Jump to content

p4 print but output in the format that was used for calculating digest

  • Please log in to reply
1 reply to this topic

#1 prcdpr



  • Members
  • Pip
  • 1 posts

Posted 14 September 2020 - 12:06 AM

I would like to use p4 print command and then verify its md5 digest.
Unfortunately p4 print outputs different line endings (CRLF) but the digest is always calculated with LF line endings.

Is it possible to force p4 print command to dump file in LF line endings (orignal)

Edited by prcdpr, 15 September 2020 - 02:37 PM.

#2 Sambwise


    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 15 September 2020 - 07:33 PM

If you can do this in a workspace (i.e. use "p4 sync" instead of "p4 print"), it's much easier, because then you have access to commands like "p4 diff -se" and "p4 clean" that will do the checksum comparison in a LineEnd-aware way.

If you're forced to use "p4 print", I think the easiest option is to do the CRLF->LF normalization yourself after doing the print command, either doing it on disk or doing it in-memory as you compute the checksum.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users