Macports的偷偷摸摸的修补源 [英] Sneaky patching source with Macports
问题描述
在我一直使用vim并了解足够的C语言之前,我已经对已安装的vim进行了自定义,以删除使我烦恼的功能". 当我切换到在Macports上使用Mac时,我通过卸载以前的任何vim端口,获取源代码,手动编辑源代码,然后让Macports使用新自定义的源代码继续安装来实现此目的.
For almost as long as I've been using vim and have known enough C, I've customised the installed vim to remove a 'feature' that annoys me. When I switched to using a Mac with macports, I achieved this by uninstalling any previous vim port, fetching the source, manually editing the source and then having Macports continue the installation, using my freshly customised source.
sh> sudo port uninstall vim
sh> sudo port fetch vim
sh> sudo /usr/bin/vim /opt/local/wherever/port/put/the/source/file.c
sh> sudo port install vim
现在[1],当我尝试此操作时,port install
命令从服务器重新获取代码,完全忽略了我的源代码编辑,使用官方"源构建了vim,而烦人的功能"仍然存在.
Now[1] when I try this, the port install
command re-fetches the code from the server, completely ignoring my source edits, builds vim with the 'official' source and the annoying 'feature' is still there.
我一直在寻找源的校验和,编辑校验和的方法以及命令行开关以忽略它们,但是没有运气.
I have looked for checksums for the source, ways to edit the checksums and command line switches to ignore them but without luck.
在编辑代码之前,我尝试使用port patch
而不是port install
,但这没什么区别.
I have tried port patch
rather than port install
before editing the code but that made no difference.
我什至发现自己正在阅读port
资料,但是我的tcl太生锈了,无法到达.
I have even found myself reading the port
source but my tcl is way too rusty to get far.
关于如何实现这一目标的任何想法? 谢谢.
Any ideas about how to achieve this? Thank you.
[1] Macports 2.0.3.我不知道它以前用于哪个版本.
[1] Macports 2.0.3. I do not know for which version this used to work.
推荐答案
我建议为vim创建一个本地端口文件,并将您的更改添加为在构建过程中应用的补丁.
I would advise to create a local portfile for vim and add your changes as a patch that is applied during the build process.
- 创建本地端口文件存储库:方法
- 将vim端口文件目录(包含文件"Portfile"和目录"files"的名为"vim"的目录)复制到本地端口文件存储库中
- 使用您对vim源代码所做的更改来创建补丁,并将其添加到文件"目录中.
- 编辑您的本地vim Portfile,以包括行
patchfiles yourpatch.diff
- 在本地端口文件存储库中再次运行
portindex
- 使用
port install -s vim
安装vim
- Create a local portfile repository: howto
- Copy the vim portfile directory (a directory called "vim" containing the file "Portfile" and directory "files") into your local portfile repository
- Create a patch with your changes of the vim source code and add it to the "files" directory.
- Edit your local vim Portfile to include the line
patchfiles yourpatch.diff
- Run
portindex
again in your local portfile repository - Install vim with
port install -s vim
我希望这会有所帮助.
这篇关于Macports的偷偷摸摸的修补源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!