[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Packaging Manual ch-11 (Was Re: Packaging Manual chapter 10 & 11)



芳尾です。

Packaging Manual  11 章 dpkg-divert の改訂版です。

最後に、
査読:<a href="http://www.debian.or.jp/";>Debian-JP Project </a><br>
という欄をつけました。

あと、diversion は、「退避バージョン」のままです。「退避」または「退避
操作」としなかったのは、「退避されたもの」としての意味を失わせたくなか
ったからです。

良い訳語がありましたら、教えてください。

ではでは。 ---- Yours, K.S.Yoshio
                mailto:shishamo@xxxxxxxxxxxxxxx
                http://www2.osk.3web.ne.jp/~shishamo
Key fingerprint = 3C 3C 1C E6 B1 65 53 58  A3 B3 6A ED BA E4 54 52


<html><head>
<title>
<!-- 
Debian Packaging Manual - Diversions - overriding a package's version of
a file
--> 
Debian Packaging Manual - 退避バージョン - あるパッケージに含まれるファ
イルを上書きするには
</title>
<link rev=made href="mailto:ijackson@xxxxxxxxxxxxxx";>
</head><body>
<h1>
<!-- 
Debian Packaging Manual - chapter 11<br>
Diversions - overriding a package's version of a file
--> 
Debian Packaging Manual -第 11 章<br>
退避バージョン - あるパッケージに含まれるファイルを上書きするには
</h1>

<!-- 
It is possible to have <kbd>dpkg</kbd> not overwrite a file when it
reinstalls the package it belongs to, and to have it put the file from
the package somewhere else instead.<P>
--> 

パッケージを再インストールする時、その中のあるファイルを <kbd>dpkg</kbd>
によって上書きさせないようにすることができます。そして、そのファイルを
どこか他の場所に置くこともできます。<p>

<!-- 
This can be used locally to override a package's version of a file, or
by one package to override another's version (or provide a wrapper for
it).<P>
--> 

この方法は、あるパッケージのあるバージョンを同一のプログラムで上書きする
場合にも使えますし、違ったパッケージのファイルを上書きする場合にも使えま
す(または、そのプログラムを包含するラッパーを提供します)。<p>

<!-- 
Before deciding to use a diversion, read <A
href="ch-alternatives.html">Alternative versions of an interface -
<kbd>update-alternatives</kbd>, chapter 10</A> to see if you really want
a diversion rather than several alternative versions of a program.<P>
--> 

退避バージョン (diversion) の使用を決定する前に、 <A
href="ch-alternatives.html">代替ツールへのインターフェース -
<kbd>update-alternatives</kbd>, chapter 10</A> を読んでください。ほんと
うに、退避バージョンを必要としているのか、単にあるプログラムのいくつかの
代替バージョンを必要としているのではないのか、確認してください。<p>

<!-- 
There is a diversion list, which is read by <kbd>dpkg</kbd>, and updated
by a special program <kbd>dpkg-divert</kbd>.  Please see <code>dpkg-divert(8)</code> for full details of its operation.<P>
--> 

特別なプログラム、 <kbd>dpkg-divert</kbd> は、退避されたパッケージのバー
ジョンリストを更新します。そして、そのリストは、<kbd>dpkg</kbd> によって
使用されます。詳しくは、<kbd>dpkg-divert(8)</kbd> をごらんください。<p>

<!-- 
When a package wishes to divert a file from another, it should call
<kbd>dpkg-divert</kbd> in its preinst to add the diversion and rename the
existing file.  For example, supposing that a <kbd>smailwrapper</kbd>
package wishes to install a wrapper around <code>/usr/sbin/smail</code>:
--> 

パッケージが、その中のファイルを他のものと置きかえようとする場合、
preinst スクリプト中から、<kbd>dpkg-divert</kbd> を呼ばなければいけませ
ん。そして、退避バージョンを付けくわえ、既存のファイルの名前を変更します。例
えば、 <kbd>smailwrapper</kbd> というパッケージが、 
<code>/usr/sbin/smail</code> を包含するラッパーをインストールしようとして
いる場合を考えます:

<pre>if [ install = &quot;$1&quot; ]; then
    dpkg-divert --package smailwrapper --add --rename \
		--divert /usr/sbin/smail.real /usr/sbin/smail
fi</pre>

<!-- 
Testing <code>$1</code> is necessary so that the script doesn't try to
add the diversion again when <kbd>smailwrapper</kbd> is upgraded.  The
<code>--package smailwrapper</code> ensures that
<kbd>smailwrapper</kbd>'s copy of <code>/usr/sbin/smail</code> can
bypass the diversion and get installed as the true version.<P>
--> 

最初の引数 <code>$1</code> をテストしているのは、<kbd>smailwrapper</kbd> 
を更新するときに、スクリプトが再度退避操作を行わないようにするためです。
オプションの <code>--package smailwrapper</code> は、 
<kbd>smailwrapper</kbd> のコピーである <code>/usr/sbin/smail</code> の退
避バージョンを作らず、かつ<kbd>smailwrapper</kbd> が本来のバージョンとし
てインストールされることを保証します。<p>

<!-- 
The postrm has to do the reverse:
--> 

postrm の場合はちょうどこの逆を行います:

<pre>if [ remove = &quot;$1&quot; ]; then
    dpkg-divert --package smailwrapper --remove --rename \
                --divert /usr/sbin/smail.real /usr/sbin/smail
fi</pre><P>

<!-- 
Do not attempt to divert a file which is vitally important for the
system's operation - when using <kbd>dpkg-divert</kbd> there is a time,
after it has been diverted but before <kbd>dpkg</kbd> has installed the
new version, when the file does not exist.
--> 

システムの運用に重要なファイルを退避しようとしないで下さい -
<kbd>dpkg-divert</kbd> の使用時には、ファイルの退避が行われた後に 
<kbd>dpkg</kbd> が新しいバージョンをインストールするまでの間、そのファイ
ルが存在しないタイミングがあるのです。

<hr>
Debian Packaging Manual
- <A href="index.html#copyright">Copyright .Aゥ1996 Ian Jackson.</A>*B
<br>
<A href="index.html#toc">Contents</A>; <A href="index.html#abstract">abstract</A>; <A href="ch-sharedlibs.html">next</A>; <A href="ch-alternatives.html">back</A>.
<br>
<address>version 2.4.1.0, 14 April 1998
<br>
Ian Jackson <A
href="mailto:ijackson@xxxxxxxxxxxxxx";>ijackson@xxxxxxxxxxxxxx</A><br>
Revised: David A. Morris <A
href="mailto:bweaver@debian.org";>bweaver@debian.org</A><br>
Maintainer: Christian Schwarz <A href="mailto:schwarz@debian.org";>schwarz@debi
an.org<br></A>
日本語訳:芳尾桂 <A
href="mailto:shishamo@xxxxxxxxxxxxxxx";>shishamo@xxxxxxxxxxxxxxx</A><br>
査読:<a href="http://www.debian.or.jp/";>Debian-JP Project </a><br>
</address>
</body></html>