Scroll to navigation

dpkg-parsechangelog(1) dpkg ユーティリティ dpkg-parsechangelog(1)

名前

dpkg-parsechangelog - Debian changelog ファイルの解析

書式

dpkg-parsechangelog [option...]

説明

dpkg-parsechangelog は、展開された Debian ソースツリーにある changelog ファイルを読み取って解析し、その情報をコンピュータに適した形式で標準出力に出力する。

オプション

-lchangelog-file
Specifies the changelog file to read information from. A '-' can be used to specify reading from standard input. The default is debian/changelog.
-Fchangelog-format
changelog ファイルの形式を指定する。デフォルトでは、changelog の末尾の近辺にある特別な行から読み取られるか、もしくは debian 標準形式が用いられる。 changelog のフォーマット も参照のこと。
-Llibdir
パーサスクリプトを検索するディレクトリを追加で指定する。このディレクトリはデフォルトのディレクトリの検索前に検索される。デフォルトのディレクトリは、現在 /usr/local/lib/dpkg/parsechangelog および /usr/lib/dpkg/parsechangelog である。
-S, --show-field field
Specifies the name of the field to show (since dpkg 1.17.0). The field name is not printed, only its value.
-?, --help
利用方法を表示して終了する。
--version
バージョン情報を表示して終了する。

パーサ用オプション

The following options can be used to influence the output of the changelog parser, e.g. the range of entries or the format of the output. They need to be supported by the parser script in question. See also NOTES.
--file file
Set the changelog filename to parse. Default is '-' (standard input).
-l, --label file
Set the name of the changelog file to use in error messages, instead of using the name from the --file option, or its default value.
--format output-format
出力形式を指定する。現在サポートされている値は dpkg および rfc822 である。 dpkg は従来からの (このオプションが存在する前からの) 出力形式であり、デフォルトである。これには Debian 制御情報形式 ( deb-control(5) を参照) に則った段落 1 つからなる。複数のエントリが指定された場合、他に指示がない限り、ほとんどのフィールドは最新のエントリに従って取得される:
Source: pkg-name
Version: version
Distribution: target-distribution
Urgency: urgency
含まれているエントリの中で、最も高い urgency の値が用いられ、要求されたバージョンすべてのコメントを (スペースで区切って) 結合した文字列が続く。
Maintainer: author
Date: date
Closes: bug-number
Closes フィールドに含まれるすべてのエントリはマージされる。
Changes: changelog-entries
changelog のエントリにあるすべてのテキストは結合される。このフィールドを Debian 制御情報形式に従った形式とするために、複数行のフィールドにおける空行は、ピリオドに置き換えられ、すべての行の先頭に空白文字が 1 つ挿入される。内容は changelog の形式に依存する。
Version, Distribution, Urgency, Maintainer, Changes フィールドは必須である。
この他、ユーザ定義のフィールドが存在してもよい。
rfc822 形式でも同じフィールドが用いられるが、出力については、changelog のエントリ毎に別の段落に分割され、各エントリのメタデータが保持される。
--since version, -sversion, -vversion
version より後のすべての変更を含む。
--until version, -uversion
version より前のすべての変更を含む。
--from version, -fversion
version 以降のすべての変更を含む。
--to version, -tversion
version 以前のすべての変更を含む。
--count number, -cnumber, -nnumber
先頭から number 分のエントリを含める ( number が 0 未満の場合は、最後から number エントリの意味となる。
--offset number, -onumber
change the starting point for --count, counted from the top (or the tail if number is lower than 0).
--all
すべての変更を含める。このオプションが設定された場合、他のオプションは無効となる。

changelog のフォーマット

標準的なフォーマットとは異なるフォーマットに対応したパーサがあれば、非標準のフォーマットを用いることもできる。
dpkg-parsechangelog に新しいパーサを使用させるには、changelog ファイルの末尾 40 行以内に、次のような Perl の正規表現: “ \schangelog-format:\s+([0-9a-z]+)\W” にマッチする行が含まれている必要がある。括弧内にフォーマットの名称を記載すること。以下に一例を示す:

@@@ changelog-format: otherformat @@@
changelog のフォーマット名は、英数字の文字列である必要がある。
こうした行があった場合、 dpkg-parsechangelog は、 /usr/lib/dpkg/parsechangelog/ otherformat もしくは /usr/local/lib/dpkg/parsechangelog/otherformat という名称のパーサを検索する。これらが存在していなかったり、実行可能でなかったりする場合はエラーとなる。デフォルトの changelog のフォーマットは debian であり、対応するパーサはデフォルトで提供されている。
パーサは changelog ファイルの先頭を標準入力に設定された状態で起動され、ファイルを読み取って (必要に応じて検索して) 必要な情報を確定し、解析した情報を標準出力経由で、 --format オプションで指定されたフォーマットで返却する必要がある。パーサは、すべての パーサ用オプション を受け付けること。
解析されている changelog フォーマットにおいて、個々の変更点の記述の間の大半、もしくはすべてが空行となる場合、それらの空行は省略されるため、結果として出力がコンパクトになる。
changelog フォーマットに日付やパッケージ名の情報が含まれていない場合、これらの情報は出力から省かれる。パーサは、これらを生成したり、別の情報源から探してきたりしてはならない。
changelog がパーサの期待するフォーマットになっていなかった場合、パーサは、実行を継続しておそらくは不正となるであろう出力を生成するよりは、0 以外の終了コードで終了すべきである。
changelog パーサは、ユーザと対話を行わなくともよい。

参考

All Parser Options except for -v are only supported since dpkg 1.14.16. Third party parsers for changelog formats other than debian might not support all options.

ファイル

debian/changelog
changelog ファイル、urgency やアップロードの distribution、あるリリース以降に行われた変更点、ソースのバージョン番号自体といった、ソースパッケージに関するバージョン固有の情報を取得するために用いられる。

翻訳者

高橋 基信 <monyo@monyo.com>. 喜瀬 浩 <kise@fuyuneko.jp>. 関戸 幸一 <sekido@mbox.kyoto-inet.or.jp>. 鍋谷 栄展 <nabe@debian.or.jp>. 倉澤 望 <nabetaro@debian.or.jp>. 石川 睦 <ishikawa@linux.or.jp>. 鵜飼 文敏 <ukai@debian.or.jp>. 中野 武雄 <nakano@apm.seikei.ac.jp>.

翻訳校正

Debian JP Documentation ML <debian-doc@debian.or.jp>.
2013-07-06 Debian Project