diff: option not recognize «--git»

本秂侑毒 提交于 2019-12-10 10:52:54

问题


When I'm trying to install depencies for a python script I get this error:

build/temp.linux-x86_64-2.7/_openssl.c:697:6: error: conflicting types for ‘BIO_new_mem_buf’
 BIO *BIO_new_mem_buf(void *, int);
      ^
In file included from /usr/include/openssl/asn1.h:65:0,
                 from build/temp.linux-x86_64-2.7/_openssl.c:413:
/usr/include/openssl/bio.h:692:6: note: previous declaration of ‘BIO_new_mem_buf’ was here
 BIO *BIO_new_mem_buf(const void *buf, int len);
      ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I try this patch found here:

diff --git a/dev-python/cryptography/cryptography-1.2.2.ebuild b/dev-python/cryptography/cryptography-1.2.2.ebuild

But then I get this error diff: option not recognize «--git»

How do I fix this error?


回答1:


diff --git is not a command, but the header of a git diff -p (patch):

What the -p option produces is slightly different from the traditional diff format:

It is preceded with a "git diff" header that looks like this:

diff --git a/file1 b/file2

Since the diffstat in the gentoo repo is in unified mode, you can copy it in a patch file, and apply it to your codebase with a patch command.
(See more examples here).

patch foo.c < patch.diff


来源:https://stackoverflow.com/questions/37228422/diff-option-not-recognize-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!