git - 运行“patch -p1 < patch-file”时出现“git binary diffs are not supported”错误
问题描述
我有一个要应用于 android 内核的 .patch 文件,我通过以下方式实现:
patch -p1 < <patch-file>
运行它后,我看到git binary diffs are not supported
了以下补丁行的打印:
+PRODUCT_COPY_FILES += \
+ hardware/ril/libquectel-ril/arm64-v8a/dir:system/bin/dir \
而是dir
在补丁文件中定义的二进制文件。
我应该初始化 git,添加所有文件,然后运行git apply patch-file
吗?
编辑:
运行git init
, git add
,之后git commit
,我跑了git apply <patch-file>
,现在我得到:
warning: device/qcom/common/rootdir/etc/init.class_main.sh has type 100644, expected 100755
error: patch failed: device/qcom/sdm845/sdm845.mk:87
error: device/qcom/sdm845/sdm845.mk: patch does not apply
warning: device/qcom/sepolicy/generic/vendor/common/file_contexts has type 100644, expected 100755
file.patch:37781: new blank line at EOF.
+
warning: system/core/init/selinux.cpp has type 100644, expected 100755
error: patch failed: system/core/init/selinux.cpp:430
error: system/core/init/selinux.cpp: patch does not apply
解决方案
推荐阅读
- neo4j - 简单的匹配查询需要很长时间
- symfony - 需要解释 postPersist 和数据刷新
- xml - serde-xml-rs 反序列化 u8 有效,但 u16 无效
- python - 带数组的欧拉隐式方法
- mysql - 如何找出每个用户登录的时间?
- ios - 我用 swift4/xcode10 制作的 CloudKit 应用程序只能在模拟器中运行
- python - 数据框中连续天数的平均值
- wso2 - 如何在 WSO2 5.4.1 中启用 X-Frame-Options?
- node.js - Nodejs模块导出,等待函数完成
- powershell - Powershell 中的快速注册表搜索器