在构建python deb包时遇到问题,抱怨修改后的二进制文件

在使用DebHelper之前,我已经构建了我的包,但是我遇到了一个非常令人沮丧的问题。
这是我的文件树:

usr/
`-- share
    |-- applications
    |   `-- create-launcher.desktop
    `-- create-launcher
        |-- bin
        |   |-- callbacks.py
        |   |-- callbacks.pyc
        |   |-- create_launcher.py
        |   |-- create_launcher.pyc
        |   |-- file_handler.py
        |   |-- file_handler.pyc
        |   |-- make_launcher.py
        |   |-- make_launcher.pyc
        |   |-- message_dialog.py
        |   |-- message_dialog.pyc
        |   `-- session
        |-- data
        |   `-- gui.glade
        |-- images
        |   `-- icon_48x48.png
        `-- README

A您可以看到,我有一些python pyc文件,它们是二进制文件和图像二进制文件。我不知道这是不是我的问题,但我已经跑了
dh_make

生成debian目录,我修改了所有必要的文件。
如果我跑步:
dh_install

一切都进入正确的debian/create启动程序/usr…位置。
不过,如果我跑步:
debuild -uc -us

我得到以下输出:
 dpkg-buildpackage -rfakeroot -D -us -uc
dpkg-buildpackage: source package create-launcher
dpkg-buildpackage: source version 0.1.2+alpha-1
dpkg-buildpackage: source changed by Narnie Harshoe <signupnarnie@gmail.com>
 dpkg-source --before-build create-launcher-0.1.2+alpha
dpkg-buildpackage: host architecture amd64
 fakeroot debian/rules clean
dh clean 
   dh_testdir
   dh_auto_clean
   dh_clean
 dpkg-source -b create-launcher-0.1.2+alpha
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building create-launcher using existing ./create-launcher_0.1.2+alpha.orig.tar.gz
dpkg-source: warning: ignoring deletion of directory share
dpkg-source: warning: ignoring deletion of directory share/applications
dpkg-source: warning: ignoring deletion of file share/applications/create-launcher.desktop
dpkg-source: warning: ignoring deletion of directory share/create-launcher
dpkg-source: warning: ignoring deletion of file share/create-launcher/README
dpkg-source: warning: ignoring deletion of directory share/create-launcher/data
dpkg-source: warning: ignoring deletion of file share/create-launcher/data/gui.glade
dpkg-source: warning: ignoring deletion of directory share/create-launcher/images
dpkg-source: warning: ignoring deletion of file share/create-launcher/images/icon_48x48.png
dpkg-source: warning: ignoring deletion of directory share/create-launcher/bin
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/message_dialog.py
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/create_launcher.py
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/callbacks.py
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/make_launcher.py
dpkg-source: warning: ignoring deletion of file share/create-launcher/bin/file_handler.py
dpkg-source: warning: newly created empty file 'usr/share/applications/create-launcher.desktop' will not be represented in diff
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/images/icon_48x48.png: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/images/icon_48x48.png in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/file_handler.pyc: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/bin/file_handler.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: warning: executable mode 0755 of 'usr/share/create-launcher/bin/create_launcher.py' will not be represented in diff
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/message_dialog.pyc: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/bin/message_dialog.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/make_launcher.pyc: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/bin/make_launcher.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/create_launcher.pyc: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/bin/create_launcher.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: cannot represent change to create-launcher-0.1.2+alpha/usr/share/create-launcher/bin/callbacks.pyc: binary file contents changed
dpkg-source: error: add usr/share/create-launcher/bin/callbacks.pyc in debian/source/include-binaries if you want to store the modified binary in the debian tarball
dpkg-source: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -b create-launcher-0.1.2+alpha gave error exit status 2

我不知道为什么它会说“忽略删除目录共享”等等。首先,它应该从usr文件夹开始,而不是共享。其次,它们不会被删除。
自从我滚动tarball之后,没有任何文件发生更改,所以我不明白二进制文件为什么会出错。
为什么它在share/下而不是usr/下?
在运行dh的dh_安装部分之前,它似乎已经死亡。
非常感谢你的帮助。


最佳答案:

经过大量的阅读和反复的尝试,我发现了什么是错误的。我跑过一次

dpkg-source -b create-launcher_0.1.2+alpha

由于某种原因,它未能删除解包的create-launcher_0.1.2+alpha.orig.tar.gz文件目录,该目录看起来像create-launcher-0.1.2+alpha.orig.6h0gqo。我查看了一下,它从文件夹开始:share,而不是usr,就像我在上面的问题中提到的那样。这让我开始思考我可能是怎么搞砸了沥青的。当然了,我用USR作为顶部文件夹构建了它,它“切”下来进行比较。我需要使用create-launcher_0.1.2+alpha/作为顶部目录来构建tar。因此,它被切断,允许“usr”dir的差异出现在每棵树的下面。
它仍然没有修好。我需要这个命令:
dpkg-source --include-binaries -b create-launcher_0.1.2+alpha

我发现你可以使用“-source-option”参数来实现这一点,比如:
debuild -uc -us --source-option=--include-binaries

这仍然失败,因为/bin目录中的vim会话文件显示了一个更改(我不知道为什么,但我需要忽略它)。DPKG源有一些忽略选项。最后的命令成功了:
debuild -uc -us --source-option=--include-binaries --source-option=-isession

我成功地完成了DEB。
希望这能帮助别人。我犯了个愚蠢的错误。我应该学会使用我的旧脚本(构建tar),而不是每次都编它。经验教训。