diff:选项无法识别«-git» [英] diff: option not recognize «--git»

查看:109
本文介绍了diff:选项无法识别«-git»的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

我尝试在此处:

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

但是然后我得到这个错误 diff:选项无法识别«--git»

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

如何解决此错误?

推荐答案

diff --git 不是命令,而是

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

-p 选项产生的内容与传统的diff格式略有不同:

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

在其前面带有"git diff".标题如下:

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

diff --git a/file1 b/file2

由于gentoo存储库中的diffstat处于统一模式,因此您可以将其复制到补丁文件中,然后 补丁命令.
(请参见此处更多示例).

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

这篇关于diff:选项无法识别&amp;#171;-git&amp;#187;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆