展讯平台Linux下升级patch方法

时间:2022-11-02 18:43:24

展讯提供的patch会把原始的代码放到old文件夹中,修改后的代码放到new文件夹中,我们要做的就是把new文件夹中相对与old文件夹中修改的部分合入到本地

首先安装rcs

sudo apt-get install rcs

查看merge用法:man merge

SYNOPSIS
merge [ options ] file1 file2 file3


DESCRIPTION
merge incorporates all changes that lead from file2 to file3 into
file1. The result ordinarily goes into file1. merge is useful for
combining separate changes to an original. Suppose file2 is the origi‐
nal, and both file1 and file3 are modifications of file2. Then merge
combines both changes.

1.merge 单个文件

merge ~/project/ur_folder_path/xxx.java old/xxx.java new/xxx.java

2.merge 多个文件

cd old
find . -type f -exec merge ~/project/TDXXX/{} {} ../new/{} \;

解析:

find . -type f 的作用是把目录下的old目录中的所有文件都列出来

之后(-exec merge ~/project/TDXXX/{} {} ../new/{} \;)我们把这些列出来的文件依次和new目录中的相应文件比较,merge到我们自己的项目中


通常展讯patch中的readme.txt在ubuntu下查看时,中文显示乱码。可以使用iconv命令对readme.txt文件进行转换(gbk转utf-8)