简介
patch的制作需要借quilt工具完成补丁,quilt 命令提供了记录修改的一个基本方式。对 Debian 打包来说,该工具需要进行自定义,从而在 debian/patches/ 目录内记录修改内容,而非使用默认的 patches/ 目录。为了避免改变 quilt 命令自身的行为,我们在这里创建一个用于 Debian 打包工作的命令别名:dquilt。之后,我们将对应内容写入 ~/.bashrc 文件。下面给出的第二行为 dquilt 命令提供与 quilt 命令相同的命令行补全功能。
具体配置
增加下面内容到~/.bashrc开机自动配置
[root@localhost /]# vim ~/.bashrc
alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
complete -F _quilt_completion $_quilt_complete_opt dquilt
创建~/.quiltrc-dpkg配置文件确保debian/patches/ 目录内记录修改内容
[root@localhost /]# vim ~/.quiltrc-dpkg
d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
# if in Debian packaging tree with unset $QUILT_PATCHES
QUILT_PATCHES="debian/patches"
QUILT_PATCH_OPTS="--reject-format=unified"
QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
QUILT_COLORS="diff_hdr=1;32:diff_add=1;34: diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi