ср, 20 июн. 2018 г. в 22:09, Stuart Henderson <s...@spacehopper.org>:
>
> On 2018/06/20 21:17, Vadim Zhukov wrote:
> > Hi,
> >
> > The Ansible "patch" module fails to work on OpenBSD because it tries
> > to use "--dry-run" command-line option on patch(1), while ours
> > supports -C/--check instead. For now, I have an obvious, hm, patch :)
> > for patch.py that replaces --dry-run with --check. But what way do
> > people prefer: to move OpenBSD's patch(1) closer to GNU one, or to add
> > some logic to patch.py that'll detect correct command-line option to
> > use?
>
> I think it would be right to add some logic. By the time you're running
> a command like this Ansible already knows what OS it's connecting to,
> it should use that knowledge, and that way it will work on old OpenBSD
> versions too.
>
> Since patch already accepts long options, it might also be worth
> accepting --dry-run as a synonym for --check, as long as it does the
> same thing.

It's absolutely the same, yes.

> > There's also an issue with --binary: we don't support this option on
> > OpenBSD, and  GNU patch manual page says it's a no-op on POSIX anyway.
> > Would it be okay to add --binary as a no-op option to our patch?
>
> It says "This option is needed on POSIX systems when applying patches
> generated on non-POSIX systems to non-POSIX files", so I think it does
> do something there? However our patch doesn't have heuristics for
> handling line-endings like GNU patch does..

Ah, I've misunderstood "binary mode". Then, yes, this is not a no-op.
This option isn't a real problem though, since if you're feeding our
patch() with invalid line endings, you're screwed already. And you can
just do not set "binary" flag in Ansible to avoid --binary there. :)

--
  WBR,
  Vadim Zhukov

Reply via email to