我使用以下方式下载了一个软件包的源代码:
$ apt-get source gkrellweather
我还确保我拥有编译依赖项:
$ sudo apt-get build-dep gkrellweather
我测试了一下,发现它可以很好地构建。
$ cd gkrellweather-2.0.8
$ debuild
它在上面的文件夹中构建了一个.deb软件包,我可以使用以下命令进行安装:
$ sudo dpkg -i ../gkrellweather*.deb
好的,一切都准备就绪。让我们开始吧!
我在Vim中打开了源代码,并进行了一些我想要的更改。然后我尝试重新构建:
$ debuild
但是我遇到了以下错误:
...
dh_clean: Compatibility levels before 5 are deprecated (level 4 in use)
dpkg-source -b gkrellweather-2.0.8
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)
dpkg-source: info: using source format `1.0'
dpkg-source: info: building gkrellweather using existing gkrellweather_2.0.8.orig.tar.gz
dpkg-source: info: building gkrellweather in gkrellweather_2.0.8-2.diff.gz
dpkg-source: error: cannot represent change to gkrellweather-2.0.8/.gkrellweather.c.swp: binary file contents changed
dpkg-source: warning: the diff modifies the following upstream files:
GrabWeather
Makefile
gkrellweather.c
dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1)
dpkg-source: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -b gkrellweather-2.0.8 gave error exit status 1
debuild: fatal error at line 1357:
dpkg-buildpackage -rfakeroot -D -us -uc failed
为什么?
-i
会通过debuild
传递给dpkg-buildpackage
,然后传递给dpkg-source
,其手册中提到可以提供一个正则表达式。没有经过测试,我猜-i'(^|/)\.(git|idea|pybuild)($|/)'
可能适合你。 - joeytwiddle