diff:选项无法识别 «--git»

diff: option not recognize «--git»

当我尝试为 python 脚本安装依赖项时,出现此错误:

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

我试试这个补丁发现 here:

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

但是我得到这个错误diff: option not recognize «--git»

如何修复此错误?

diff --git不是命令,而是header of a git diff -p(补丁):

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

由于gentoo repo中的diffstat是统一模式的,可以在补丁文件中复制,apply it to your codebase with a patch command.
(参见 more examples here)。

patch foo.c < patch.diff