3

I am packaging a piece of Python software that uses DistUtilsExtra. When running python setup.py install in my debian/rules, DistUtilsExtra automatically recompiles the translation template .pot file and updates it directly in the source repository. As a result of that, the second time I execute the packaging commands (be it with debuild or pdebuild) an automatic patch file gets created (since it thinks I have manually updated the .pot file). This patch is obviously unwanted in the Debian package and I am searching for a way to not generate it.

One solution would be for DistUtilsExtra to not change the .pot file in the source repository, but for now that's not possible. I am thus testing another solution: create an override for the clean instruction that extracts the original .pot file from the .orig.tar.gz tarball, done like this in debian/rules:

override_dh_clean:
    tar -zxvf ../<projname>_*.orig.tar.gz --wildcards --strip-components=1 <projname>-*/po/<projname>.pot
    dh_clean

However I've been told on the debian-mentors mailing list that the original tarball is not assured to be located in ../. I am thus wondering if there is a way to reliably access the .orig.tar.gz tarball from inside debian/rules, like a "variable" that would contain its location?

4

2 回答 2

2

严格来说,这不是对如何在为 Debian 打包时访问原始 tarball 问题的答案?,但这就是我解决引发我问题的问题的方法,所以这里是:

我发现 Raphaël Hertzog 的一篇有趣的博客文章解释了如何在构建 Debian 软件包时忽略自动生成的文件。这是通过在文件中传递--extend-diff-ignore选项来完成的。因此,我从 中删除了建议的命令,不再创建不需要的自动补丁。dpkg-sourcedebian/source/optionsoverride_dh_clean

于 2011-04-19T22:17:27.170 回答
0

自动生成文件的通常解决方案是在清理期间删除它们。

于 2012-01-11T08:49:01.287 回答