-1

数週間の闘争の後、パッケージのインストールと削除に適したミディアム ネイティブ パッケージの debian パッケージを作成することができました。

http://www.quietsche-entchen.de/cgi-bin/wiki.cgi/-wiki/CreatingDebianPackages Debian wiki http://wiki.debian.org/HowToPackageForDebian http://www.debian.org/doc/ manuals/maint-guide/これらは初心者向けの非常に優れた資料です。

基本的な問題があります。パッケージを更新すると、すべてのファイル data.tar.gz がデフォルトで更新されます。

すべてのファイルに格納されているキー変数に基づいて、data.tar.gz で更新されるファイルはごくわずかです。

preinst スクリプトを実行している解凍後、data.tar.gz 内のすべてのファイルは既に更新されています。

私の考えは、パッケージをアップグレードする前に最初にファイルをバックアップし、ファイル内のキー変数をチェックすることでした..キー変数が現在の変数よりも大きい場合は、それを置き換えます..

つまり、簡単なバックアップ スクリプトを作成し、postinst ファイルで実行しています。

私はこれが良い考えだとは思わない..そして、ダッシュスクリプトの制限を超えると、それは非常に難しい仕事になります..

4

1 に答える 1

1

What are you trying to accomplish here? During the reinstallation (or upgrading) of a Debian package, replacement of all of the non-conffiles with the latest version is exactly what's supposed to happen. If the file hasn't changed since the last installed version of the package then there's no harm in updating it anyway, and if is has changed, it's supposed to be updated.

If you have specific files which might be modified by the user and should be preserved across upgrades, make then conf files. The package system will prompt the user and ask them if they want to keep the package maintainer's version or the locally modified version.

(But if you're going to make every file a conf file, then you're probably doing something wrong.)

To make a file a conffile, list it in debian/conffiles. But if the file is going to be installed under /etc then you don't need to do this because dh_installdeb will do it for you.

EDIT following additional information in comment:

Suppose you have files test1.sh and test2.sh (among others) in your package. In the Debian world, they are either conffiles are intended to be modified by the end user, or they're not.

conffiles should be relatively few in number and as short as possible, to minimize the burden of having to reconcile changes made by the package maintainer with conflicting changes made by the end user.

If there are things mixed into the code that the end user is likely to want to tune, try to factor them out into a configuration file. If you put that file in /etc, you don't even have to manually designate it as a conffile.

If the end user needs to make a change to a non-conffile, they should use the dpkg-divert protocol to (1) move the original file aside, and (2) edit a copy. Diverted files are respected by package upgrades. The end user who uses dpkg-divert should be aware that things might break after upgrades as a result, because the package maintainer hasn't foreseen that these files would be modified by end users and the locally modified version might be incompatible with a newly upgraded version of a different file. dpkg-divert should be used carefully and sparingly.

于 2012-05-14T19:47:31.983 に答える