精华内容
下载资源
问答
  • 关于patch操作的各种错误的解决办法,收藏一下,非常好 http://www.markusbe.com/2009/11/how-to-apply-a-patch-and-solve-hunk-failed-cant-find-file-to-patch-and-others/
    展开全文
  • 执行 patch 命令,将...can’t find file to patch at input line 3 Perhaps you should have used the -p or –strip option?原因: 目标文件没有找到。也就会如下DEMO代码第一行的文件 nginx-proxy.conf 文件没有

    执行 patch < nginx-proxy.diff 命令,将文件修改应用到文件中,报告如下错误:
    can’t find file to patch at input line 3
    Perhaps you should have used the -p or –strip option?

    原因:
    目标文件没有找到。也就会如下DEMO代码第一行的文件 nginx-proxy.conf 文件没有找到,或者这里拼写错误,或者文件夹路径错误导致。

    --- nginx-proxy.conf    2017-10-30 15:37:35.000000000 +0800
    +++ nginx-proxy.new 2017-10-30 15:40:14.000000000 +0800
    展开全文
  • Fake License for Autodesk eagle
  • //git format patch git format-patch --subject-prefix="U-Boot][PATCH Vx" --stat -p -n - git format-patch --subject-prefix="PATCH v2" --cover-letter --stat -p -n10 ...git format-patch -M (rename file)
    //git format patch
    
    git format-patch --subject-prefix="U-Boot][PATCH Vx" --stat -p -n -

    git format-patch --subject-prefix="PATCH v2" --cover-letter --stat -p -n10

    git format-patch -M (rename file)

    // u-boot
    git send-email --no-chain-reply-to --no-signed-off-by-cc --quiet --smtp-server xxxxx(smpt address) --suppress-cc=all --confirm=always  --to u-boot@lists.denx.de --cc sbabic@denx.de

    //USB
    git send-email --no-chain-reply-to --no-signed-off-by-cc --suppress-cc all -quiet --smtp-server xxxxx(smpt address)  --to balbi@ti.com  --to gregkh@suse.de --to stern@rowland.harvard.edu --cc linux-usb@vger.kernel.org 


    If it is the bug, you can add stable@kernel.org

    --cc stable@kernel.org


    //For v2 patch please add below at  Signed-off-by

        Signed-off-by: Peter Chen <hzpeterchen@gmail.com>

        ---
        Changes for v2:
            -  what changes
           

    展开全文
  • apply-patch-to-file脚本允许您将 Git 补丁应用于内容相同但名称或文件路径不同的文件,而无需手动修改补丁本身。 指示 使用以下语法: apply-patch-to-file [-i] <patch> [-f <file>] <patch> [-h] 不指定任何...
  • 最近在windows上做一个开源包的build工作,需要打patchpatch文件是在linux... failed: hunk, file patch.c, line 321 但是操作目录文件夹下没有patch.c文件。上网查了一下,顺便给自己做个总结: 背景调查: 大多数

    问题阐述:

    最近在windows上做一个开源包的build工作,需要打patch,patch文件通过diff命令生成的,使用参数(Options)为-Naur。但是当我在windows的command prompt(有安装cygwin)下做的时候先后报出如下错误:

    1.Assertion failed: hunk, file patch.c, line 321  但是操作目录文件夹下没有patch.c文件。

    2.patching file `mspack\system.h'

    Hunk #1 FAILED at 10.
    Hunk #2 FAILED at 43.
    Hunk #3 FAILED at 59.
    3 out of 3 hunks FAILED

    上网查了一下,顺便给自己做个总结:


    背景调查:

    大多数的LINUX/UNIX操作系统,比如ubuntu, suse,centos,都使用LF(linefeed)做为行尾符(line ending),即就是'\n',ASCII 码是10,用十六进制表示为0x0A;

    微软的Windows例外,Windows中要加回车键CRLF(carriage return followed by a linefeed ),即就是'\r\n',ASCII码分别是 13 10,用十六进制表示为0x0D,0x0A,相信有过在windows上调试串口UART的人经常看到0x0d,0x0a;

    MacOS采用回车符CR(carriage return)作为行尾符'\r', ASCII码值是13,用十六进制表示为0x0D。

    所以在unix操作系统下打的patch直接在windows的dos环境下是用不成的,这样会报出第一个错误:Assertion failed: hunk, file patch.c,line 321   实际上并不一定存在patch.c文件。

    第二个错误上网查询说大部分是路径不对或者patch文件本身有问题导致的,当时仔细看了应该觉得路径什么的都对,只是注意到patch文件中的目录层级划分使用的是windows风格,类似于:C:\Program Files (x86)\VMware\VMware Workstation\x64\file.patch, 而linux中的目录划分是类似于:/home/brandon/data/source/path/to/dir/file.patch。注意字符'\' 和字符'/'的区别。这样如果在linux下打patch,就会把整个路径当成一个字符串处理“C:\Program Files (x86)\VMware\VMware Workstation\x64\file”,而不是真的按照原来的在C盘目录下找VMware文件夹,再在该文件夹下找VMware Workstation文件夹, 在该目录下找到x64文件夹,最后找到file文件并且打patch。


    References:

    http://www.microhowto.info/howto/convert_the_line_endings_in_a_text_file_from_unix_to_dos_format.html

    http://www.microhowto.info/howto/convert_the_line_endings_in_a_text_file_from_dos_to_unix_format.html

    http://stackoverflow.com/questions/14282617/hunk-1-failed-at-1-whats-that-mean


    解决方案:

    大概做了一些背景调查后,我开始去解决问题,修改了编译脚本,提交代码,让jenkins去build。由于公共的jenkins机器里面有很多编译包,所以跑起来很慢,差不多6,7个小时才能跑完一次,上班也就只能看到一次结果,修改后只能等第二天查看结果。所以我自己搭建了一台环境,是克隆的jenkins Windows编译环境,vmware的vcenter确实很好用。可是我这边的跑过了,但是jenkins就是跑不过,到我提交的那个包就出错,折腾了好几天...

    为了搞清楚我在windows下和linux下都有尝试去复现问题。

    第一个错误比较简单, 用了todos命令将patch文件从unix 格式转换成dos格式,打patch时加了参数"--binary",fix了这个bug,没有再报Assertion failed的错误,其实还有很多方法可以解决line endings的问题,比如用unix2dos,sed命令等,相应的还有dos2unix命令,fromdos命令。要使用todos命令,需要先安装 tofrodos包,tofrodos安装包和unix2dos安装包在debian-based系统下的安装:

    brandon$sudo apt-get install   tofrodos 

    brandon$sudo apt-get install dos2unix

    brandon$

    brandon$todos -h
    tofrodos Ver 1.7.8 Converts text files between DOS and Unix formats.
    Copyright 1996-2008 by Christopher Heng. All rights reserved.
    Usage: todos [options] [file...]
    -a Always convert (DOS to Unix: kill all CRs;
    Unix to DOS: convert all LFs to CRLFs)
    -b Make backup of original file (.bak).
    -d Convert DOS to Unix.
    -e Abort processing files on error in any file.
    -f Force: convert even if file is not writeable.
    -h Display help on usage and quit.
    -l file Log most errors and verbose messages to <file>
    -o Overwrite original file (no backup).
    -p Preserve file owner and time.
    -u Convert Unix to DOS.
    -v Verbose.
    -V Show version and quit.

    brandon$

    brandon$

    brandon$fromdos -h
    tofrodos Ver 1.7.8 Converts text files between DOS and Unix formats.
    Copyright 1996-2008 by Christopher Heng. All rights reserved.
    Usage: fromdos [options] [file...]
    -a Always convert (DOS to Unix: kill all CRs;
    Unix to DOS: convert all LFs to CRLFs)
    -b Make backup of original file (.bak).
    -d Convert DOS to Unix.
    -e Abort processing files on error in any file.
    -f Force: convert even if file is not writeable.
    -h Display help on usage and quit.
    -l file Log most errors and verbose messages to <file>
    -o Overwrite original file (no backup).
    -p Preserve file owner and time.
    -u Convert Unix to DOS.
    -v Verbose.
    -V Show version and quit.

    brandon$

    brandon$todos -d -f /path/to/file.patch

    brandon$patch -p1 < ../need-file.patch --binary

    一共有两个patch文件,jenkins跑的时候打第一个patch没问题,但是打第二个patch就会报第二个错误,去看脚本代码都是执行了todos命令的:

       for p in `ls | grep patch`
    
    do
    todos -f $p
    done

    很奇怪第二个脚本一直报 hunks FAILED的错误。在自己克隆的机器上是能跑的过得,但是当我执行这个命令:todos -u -f /path/to/file.patch,就会报这个错误,只带-f参数或者-d -f就可以顺利通过,所以最后又在打patch之前又执行了一次“todos -d -f /path/to/file2.patch” 然后执行“patch -p1 < ../file2.patch --binary”最后顺利通过。

    这里有些不理解的是,脚本里已经有了对patch文件的todos命令了,而且第一个file1.patch顺利跑过但是但是第二个patch文件为什么默认执行的是"todos -u -f file2.patch"命令。在linux下我是在vim中输入:%s/\\/\//g将patch文件中的字符‘\’替换成'/'的。


    展开全文
  • How to contribute your first patch to Mesos

    千次阅读 2015-07-10 13:23:42
    1. Warm up with Mesos Follow http://mesos.apache.org/gettingstarted/ to build and run Mesos first. If want to commit patch, make sure use git to clone to code. 2. Commit Patch Process 2.1 Chec
  • Applies to: Oracle Universal Installer - Version 10.2.0.4 to 11.2.0.3 [Release 10.2 to 11.2] Oracle Database - Enterprise Edition - Version 10.2.0.4 to 11.2.0.3 [Release 10.2 to 11.2] Information
  • This article describes how to create a patch file for Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) named Sample.msi. Sample.msi is a sample package that is included with the development to
  • test_from_to_patch

    2020-11-13 15:41:19
    patch是Unix上的應用程式,由美國程式設計師拉里·沃尔(Larry Wall)於1985年所開發。它會利用一種名叫「patch file」(有時直接被稱為 patch)的文字檔案,來更新文字檔案
  • How to apply the kernel patch Code View:bash> cd /usr/srcbash> wget www.kernel.org/pub/linux/kernel/people/akpm/patches/X.Y/X.Y.Z/X.Y.Zmm2/X.Y.Z-mm2.bz2Apply the patch:bash> cd /us
  • First, how to create patch file? Patch file is a readable file that created by diff with -c (context output format). It doesn’t matter and if you wanna know more, man diff. To patch the entire folder...
  • patch

    2013-08-13 16:54:21
    diff –uN from-file to-file >to-file.patch patch –p0 patch –RE –p0 多个文件 diff –uNr from-docu to-docu >to-docu.patch patch –p1 patch –R –p1 首先介绍一下diff和patch。在这里...
  • How to patch in YOCTO

    千次阅读 2016-12-23 19:55:07
    This article introduce the procedures to patch successfully in few steps!
  • The original article is here http://jungels.net/articles/diff-patch-ten-minutes.html ...The Ten Minute Guide to diff and patch Situation one: you are trying to compile a package from source and
  • Git is quite common nowadays and a lot of people are asking me how they can create a patch file. Creating a patch file with git is quite easy to do, you just need to see how it's done a few times.
  • 1、svn报错 refers to a file, not a directorysvn co http://server.com/svn/trunk/test.file test.filesvn: URL 'http://server.com/svn/trunk/test.file test.file' refers to a file, not a directory问题根本...
  • When applying a needed patch to the Grid Infrastructure Home for ASM or CRS the opatch utility may error out with the messages:   ApplySession failed: ApplySession failed to prepare the system. ...
  • How to patch and rebuild an RPM package

    千次阅读 2013-12-02 10:00:41
    转自:... How to patch and rebuild an RPM package The following describes how to derive a patch for a modification you need to make to the source code o
  • How to Patch PetaLinux Modifying the kernel, drivers and standalone components Posted on January 2, 2021 |Jeff Johnson When we build PetaLinux for custom hardware we invariably need to modify ...
  • A note of porting yaffs2 file system to linux 2.6.18, part one.Platform: broadcom 97405, mips(support SMP), linux 2.6.18.Nand flash: 128MBPage size: (2048 + 64 spare) BytesBlock size:(128K +
  • 转自 http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/ Git is quite common nowadays and a lot of people are asking me how they can create a patch file. Creating a patch file ...
  • diff . patch备用

    2012-07-18 17:51:08
    diff –uN from-file to-file >to-file.patch patch –p0 patch –RE –p0 多个文件 diff –uNr from-docu to-docu >to-docu.patch patch –p1 patch –R –p1 <to-docu.patch

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 58,127
精华内容 23,250
关键字:

filepatchto