[英]Having trouble building python deb package , complain about modified binary
我在使用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
你可以看到,我有一些python pyc文件是二進制文件和圖像二進制文件。 我不知道這是不是我的問題,但我已經跑了
dh_make
生成debian目錄,我修改了所有必要的文件。
如果我跑:
dh_install
一切都進入正確的debian / create-launcher / 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_install部分之前,它似乎正在消亡。
非常感謝。
經過大量的閱讀和反復試驗,我發現了什么是錯的。 我跑了一個
dpkg-source -b create-launcher_0.1.2+alpha
由於某種原因,它無法刪除看起來像create-launcher-0.1.2 + alpha.orig.6h0gQo的解壓縮的create-launcher_0.1.2 + alpha.orig.tar.gz文件目錄。 我看着它,它開始於文件夾:分享,而不是像我在上面的問題中提到的那樣。 這讓我開始思考如何搞砸建造焦油。 果然,我用usr作為頂級文件夾構建它,然后它“切斷”它來進行比較。 我需要使用create-launcher_0.1.2 + alpha /作為頂級目錄來構建tar。 因此它被切斷,允許“usr”目錄的差異在每棵樹的下方。
它仍然沒有正確建立。 我需要這個命令:
dpkg-source --include-binaries -b create-launcher_0.1.2+alpha
我發現你使用“--source-option”參數執行此操作,如:
debuild -uc -us --source-option=--include-binaries
這仍然失敗,因為我在/ bin目錄中的vim會話文件顯示了一個更改(我不知道為什么,但我需要忽略它.dpkg-source有一些忽略選項。這個最后的命令做了訣竅:
debuild -uc -us --source-option=--include-binaries --source-option=-isession
我成功地推動了deb。
希望這有助於那里的人。 我這個愚蠢的錯誤。 我應該學習使用我的舊腳本(構建tar),而不是每次都使用它。 學過的知識。
您不應該在源包中包含所有*.pyc
文件。 在構建二進制包時,Debian可以自動為您編譯這些內容。 在安裝步驟中,確保將所有文件放在適當位置,或者編寫一個debian/install
文件來執行此操作。
dh
有一個python插件,如果使用標准工具鏈,它可以自動處理Python項目。 你可以告訴dh_make
使用它(它只是dh
在debian/rules
文件中的一個選項,基本上)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.