从补丁脚本

时间:2017-10-06 08:24:44

标签: patch

当我运行补丁时,其中一个文件失败。我想从patch.x.x.x.sh删除相应的行,以便除了此文件之外其他所有内容都要修补。

希望有人能解释这个程序。

例如,我正在尝试应用Patch SUPEE-10336并收到错误:

[http]$ bash PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php
patching file app/locale/en_US/Mage_Usa.csv
Hunk #1 FAILED at 99.
1 out of 1 hunk FAILED -- saving rejects to file app/locale/en_US/Mage_Usa.csv.rej

我想编辑PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh,因此我从负责此文件的补丁中删除该行。

1 个答案:

答案 0 :(得分:0)

我看不到有人对这个问题感兴趣,但我认为无论如何我都会发布答案。

如果您在任何文本编辑器中打开补丁,并使用__PATCHFILE_FOLLOWS__命令找到合并文件的部分diff。在make case中,“Mage_Usa.csv”文件导致了问题所以我发现补丁的一部分负责这个文件:

diff --git app/locale/en_US/Mage_Usa.csv app/locale/en_US/Mage_Usa.csv
index 072170d..5e8f844 100644
--- app/locale/en_US/Mage_Usa.csv
+++ app/locale/en_US/Mage_Usa.csv
@@ -99,7 +99,7 @@
 "First-Class Mail Large Envelope","First-Class Mail Large Envelope"
 "First-Class Mail Large Postcards","First-Class Mail Large Postcards"
 "First-Class Mail Letter","First-Class Mail Letter"
-"First-Class Mail Parcel","First-Class Mail Parcel"
+"First-Class Package Service - Retail","First-Class Package Service - Retail"
 "First-Class Mail Postcards","First-Class Mail Postcards"
 "First-Class Package International Service","First-Class Package International Service"
 "First-Class Package Service","First-Class Package Service"

我删除了补丁的整个部分并重新运行它是SSH。

这一次:

[http]$ bash PATCH_SUPEE-10336_CE_1.9.2.4_v1.sh
Checking if patch can be applied/reverted successfully...
Patch was applied/reverted successfully.

我手动更改了文件Mage_Usa.csv中的USPS名称(我删除的补丁部分)。