7

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

「ディレクトリ共有の削除を無視する」などについて話している理由がわかりません。まず、share ではなく usr フォルダーから開始する必要があります。第二に、それらは削除されません。

tarball を展開してからファイルが変更されていないため、バイナリでエラーが発生する理由がわかりません。

usr/ ではなく、share/ の下を検索するのはなぜですか?

dh の dh_install 部分を実行する前に死んでいるようです。

大変助かりました。

4

2 に答える 2

11

たくさんの読書と試行錯誤の末、私は何が悪いのかを理解しました。私は走っていた

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ではありません。それで、タールを作るのをどうやって台無しにしたのか考え始めました。案の定、トップフォルダーとして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

私はデブをうまく転がすことができました。

これが誰かを助けてくれることを願っています。私の側の愚かな間違い。毎回作成するのではなく、古いスクリプトを使用して(tarを作成するために)学ぶ必要があります。学んだ教訓。

于 2012-03-13T07:00:37.213 に答える