2010-05-05

【備忘録】drpm パッケージの作り方

Fedora 11 から yum のプラグインとして採用された、RPM の差分インストール (delta RPM, drpm) を処理する presto は、今では当たり前の機能のようになってしまっています。しかし、どうやって drpm を作成するのか知らなかったので、調べてみました。

drpm を作成するには、presto-utils が必要になります。

# yum install presto-utils

presuto-utils に収録されている createdeltarpms(処理の実体は Python のスクリプト)が RPM の差分を生成します。

createdeltarpms [options] directory-of-packages directory-of-deltarpms

Options:
-d, --dist-update <dir> = optional directory containing old distribution
to create an update from
-c, --count <number> = optional maximum number of deltarpms to create
per package. Default is maximum available
-n, --no-first = Don't create deltarpm against first rpm if number exceeds
count. Useful if you are running a continually-updated
distribution rather than one with set release cycles.
-q, --quiet = run quietly
-v, --verbose = run verbosely
-h, --help = show this help
-V, --version = output version

試しに、rpms というフォルダに、sawarabi-gothic-fonts の二種類のリリースの RPM パッケージをコピーし、drpms という空のディレクトリを用意して、createdeltarpms を実行してみました。

$ ls rpms
sawarabi-gothic-fonts-20100315-1.fc12.noarch.rpm
sawarabi-gothic-fonts-20100430-1.fc13.noarch.rpm
$ createdeltarpms ./rpms ./drpms
/usr/lib/python2.6/site-packages/presto-utils/dumpMetadata.py:23: DeprecationWar
ning: the md5 module is deprecated; use hashlib instead
import md5
/usr/lib/python2.6/site-packages/presto-utils/dumpMetadata.py:24: DeprecationWar
ning: the sha module is deprecated; use the hashlib module instead
import sha
Using base dir: rpms
Using destination dir: drpms
Generated delta rpm for sawarabi-gothic-fonts.noarch - 20100315-1.fc12 => 201004
30-1.fc13
$ ls drpms
sawarabi-gothic-fonts-20100315-1.fc12_20100430-1.fc13.noarch.drpm

RPM レポジトリを公開しているわけではないので、差分パッケージの作成方法が解ったからといって、なにかにすぐ使えるということはなさそうです。差分の操作をローカルでもう少しできるのかもしれません。
 

参考サイト


[1] 差分アップデートでダウンロード時間を短縮!--Fedora 11のDelta RPMを活用する - builder by ZDNet Japan
[2] 着実な進化を見せるFedora 11新機能レビュー - SourceForge.JP Magazine : オープンソースの話題満載
 

0 件のコメント: