patch

ubuntu下diff patch打补丁

耗尽温柔 提交于 2020-04-07 08:48:04
首先把个人总结写出来,然后你们有空的话就继续往下看: a:最原始文件 b:修改过后的文件 diff -uN b a > c.patch 补丁出来了,在当前文件夹下,一定要看清楚文件的顺序 patch -p0 < c.patch 给b打上了补丁,让其变为了a patch -RE -p0 < c.patch 将上面做好的还原回去,相当于之前你什么都没干 aa:最原始的文件夹 bb:修改过后的文件夹 diff -ruN bb aa > cc.patch 补丁出来了,在当前文件, 一定要看清楚文件夹的顺序 cp cc.patch bb 给文件夹打补丁,要将补丁拷贝到bb文件夹的才行哦 patch -p1 < cc.patch 现在bb文件夹里面的所以内容都和aa一样了 patch -RE -p1 < cc.patch 将上面做好的还原回去,相当于之前你什么都没干 ubuntu下patch打补丁的详细解释! 有空的话就看看吧,没空就把上面记住就行了,我学这个的目的就是为了将我的android内核每次修改都打个补丁,要好几百M,所以得搞清楚才行! 首先介绍一下diff和patch。在这里不会把man在线文档上所有的选项都介绍一下,那样也没有必要。 在99%的时间里,我们只会用到几个选项。所以必须学会这几个选项。 1、diff -------------------- NAME diff -

Apply patch to file that's under Git without using Git?

邮差的信 提交于 2020-03-06 08:58:07
问题 I checked out the latest OpenSSL from Git: git clone git://git.openssl.org/openssl.git One of the devs sent me a patch for AARCH64 to test: $ cat RT4237.diff diff --git a/crypto/ec/asm/ecp_nistz256-armv8.pl b/crypto/ec/asm/ecp_nistz256-armv8.pl index 9d1bce1..ce6b69e 100644 --- a/crypto/ec/asm/ecp_nistz256-armv8.pl +++ b/crypto/ec/asm/ecp_nistz256-armv8.pl @@ -1289,6 +1289,9 @@ $code.=<<___; stp $acc0,$acc1,[$rp_real,#$i] stp $acc2,$acc3,[$rp_real,#$i+16] ___ +$code.=<<___ if ($i == 0); + adr

Apply patch to file that's under Git without using Git?

被刻印的时光 ゝ 提交于 2020-03-06 08:57:53
问题 I checked out the latest OpenSSL from Git: git clone git://git.openssl.org/openssl.git One of the devs sent me a patch for AARCH64 to test: $ cat RT4237.diff diff --git a/crypto/ec/asm/ecp_nistz256-armv8.pl b/crypto/ec/asm/ecp_nistz256-armv8.pl index 9d1bce1..ce6b69e 100644 --- a/crypto/ec/asm/ecp_nistz256-armv8.pl +++ b/crypto/ec/asm/ecp_nistz256-armv8.pl @@ -1289,6 +1289,9 @@ $code.=<<___; stp $acc0,$acc1,[$rp_real,#$i] stp $acc2,$acc3,[$rp_real,#$i+16] ___ +$code.=<<___ if ($i == 0); + adr

Apply patch to file that's under Git without using Git?

我的未来我决定 提交于 2020-03-06 08:57:28
问题 I checked out the latest OpenSSL from Git: git clone git://git.openssl.org/openssl.git One of the devs sent me a patch for AARCH64 to test: $ cat RT4237.diff diff --git a/crypto/ec/asm/ecp_nistz256-armv8.pl b/crypto/ec/asm/ecp_nistz256-armv8.pl index 9d1bce1..ce6b69e 100644 --- a/crypto/ec/asm/ecp_nistz256-armv8.pl +++ b/crypto/ec/asm/ecp_nistz256-armv8.pl @@ -1289,6 +1289,9 @@ $code.=<<___; stp $acc0,$acc1,[$rp_real,#$i] stp $acc2,$acc3,[$rp_real,#$i+16] ___ +$code.=<<___ if ($i == 0); + adr

linux打补丁和git打patch方法

 ̄綄美尐妖づ 提交于 2020-03-05 21:59:22
一、linux打补丁方法 1、处理单个文件补丁的方法: # 产生补丁 diff -uN from-file to-file >to-file.patch # 打补丁 patch -p0 < to-file.patch # 取消补丁 patch -RE -p0 < to-file.patch 2、对整个文件夹打补丁的情况: # 产生补丁 diff -uNr from-docu to-docu >to-docu.patch # 打补补丁 cd to-docu patch -p1 < to-docu.patch # 取消补丁 patch -R -p1 <to-docu.patch 二、git打patch方法 1、git format-patch <commit> (推荐) 只适用于git的patch 包含diff信息,包含提交人,提交时间等 如果git format-patch 生成的补丁不能打到当前分支,git am会给出提示,并协助你完成打补丁工作 例: 从master checkout一个新分支修改然后与master对比生成patch。 git format-patch -M master //-M选项表示这个patch要和那个分支比对 git am 001-xxx.patch(不必重新commit) 2、git diff <commit> 生成标准的patch,只包含diff信息

Ubuntu14.04下kpatch源码安装使用

梦想的初衷 提交于 2020-02-29 09:00:53
背景   Kpatch是给Linux内核打热补丁的工具,所谓热补丁,就是指打完补丁后,补丁可立即生效,而不需要像传统打补丁那样必须重启Linux才能生效。 Kpatch简介   最早出现的打热补丁工具不是Kpatch,而是Ksplice。但是Ksplice被Oracle收购后,一些发行版生产商就不得不开发自己的热补丁工具,分别是Redhat的Kpatch和Suse的KGraft。同时,在这两家厂商的推进下,kernel4.0开始,开始集成了livepatch技术,该技术和其他热补丁技术类似。   Kpatch虽然是Redhat研发,但其也支持Ubuntu、Debian、Oracle Linux等的发行版,本文将介绍在 Ubuntu14.04 下安装和使用Kpatch软件。 不足   热补丁不是万能的,尤其是现在技术还不足够成熟的时候。在使用Kpatch热补丁前,我们需要知道Kpatch的不足之处:     1.如果在已经打过patch的环境继续打patch,那么新patch必须是基于上个patch打的补丁。     2.不支持修改数据结构的patch,如果有这样的patch,用户必须改代码。     3. 不支持修改__init函数的补丁。     4.不支持修改静态数据。     5.不支持修改vdso的函数,因为其运行在用户空间。 准备   注意

Is there a NuGet equivalent for deploying content to end users?

痴心易碎 提交于 2020-01-31 09:36:46
问题 I have a c# application and I am mainly concerned with pushing out automatic updates to clients running my software. These updates can be anything from a new / patched dll to new resource file. I know I can create a ClickOnce application to get part way there, but it doesn't allow much control as I would like (for example, I want to be able to easily "bundle" 3rd party components with my software or be able to have the user decide which components they want to have updated). I see that

Using python's mock patch.object to change the return value of a method called within another method

孤街浪徒 提交于 2020-01-30 13:53:34
问题 Is it possible to mock a return value of a function called within another function I am trying to test? I would like the mocked method (which will be called in many methods I'm testing) to returned my specified variables each time it is called. For example: class Foo: def method_1(): results = uses_some_other_method() def method_n(): results = uses_some_other_method() In the unit test, I would like to use mock to change the return value of uses_some_other_method() so that any time it is

Using python's mock patch.object to change the return value of a method called within another method

一个人想着一个人 提交于 2020-01-30 13:53:31
问题 Is it possible to mock a return value of a function called within another function I am trying to test? I would like the mocked method (which will be called in many methods I'm testing) to returned my specified variables each time it is called. For example: class Foo: def method_1(): results = uses_some_other_method() def method_n(): results = uses_some_other_method() In the unit test, I would like to use mock to change the return value of uses_some_other_method() so that any time it is

Amended commits revert to previous commit

余生颓废 提交于 2020-01-25 07:28:11
问题 I have a repo with master branch. I have patch-sets 1 to 10 amended in a single commit. Now I have amended the 11th patch-set in that commit and pushed the code in gerrit. I want to revert the commit back to 10th commit and push. How do I revert, as if I see git log, it does not list the commits in that patch-set. But it rather takes it as a single commit. I have explained the sequence of actions done below. Sequence of actions 1. Initially for patch-set #1 git clone repo made changes to code