darcs-buildpackageを使ってみる
意外に簡単。
debian/とupstreamをまとめてdarcsで管理するツール。
準備。~/.darcs-buildpackgeを設定。リポジトリをどこに展開するか設定する。
repobase = /home/takaki/dbp
upstreamrepo = %(repobase)s/%(package)s.upstream
debianrepo = %(repobase)s/%(package)s
まず最初のリポジトリを作成する。
$ dbp-importdsc tokyocabinet-haskell_0.0.2-1~1.dsc
VCSCMD: darcs
LOGTEXT Imported tokyocabinet-haskell-0.0.2
into Darcs repository
Finished recording patch 'Imported tokyocabinet-haskell-0.0.2'
Finished tagging patch 'TAG UPSTREAM_tokyocabinet-haskell_0.0.2'
Finished pulling and applying.
dpkg-source: warning: extracting unsigned source package (/home/takaki/deb/htc/tokyocabinet-haskell_0.0.2-1~1.dsc)
dpkg-source: extracting tokyocabinet-haskell in tokyocabinet-haskell-0.0.2
dpkg-source: info: unpacking tokyocabinet-haskell_0.0.2.orig.tar.gz
dpkg-source: info: applying tokyocabinet-haskell_0.0.2-1~1.diff.gz
VCSCMD: darcs
LOGTEXT Imported tokyocabinet-haskell-0.0.2
into Darcs repository
Finished recording patch 'Imported tokyocabinet-haskell-0.0.2'
Finished tagging patch 'TAG DEBIAN_tokyocabinet-haskell_0.0.2-1~1'
$
これで ~/dbpにtokyocabinet-haskellとtokyocabinet-haskell.upstreamという二つのリポジトリが作成される。debをbuildする作業はtokyocabinet-haskellのほうで行う。_darcsディレクトリが存在するのでそのままdebuildをやっても駄目である。darcs-buildpackageを利用する。
buildの風景は省略。
さて、新しいupstreamができたとき、uupdateを今までは使ったが変わりにdbp-importorigを使う。
$ dbp-importorig ~/Desktop/tokyocabinet-haskell-0.0.4.tar.gz tokyocabinet-haskell 0.0.4
VCSCMD: darcs
LOGTEXT Imported tokyocabinet-haskell-0.0.4
into Darcs repository
Finished recording patch 'Imported tokyocabinet-haskell-0.0.4'
Finished tagging patch 'TAG UPSTREAM_tokyocabinet-haskell_0.0.4'
$
という具合になる。
debの作業用リポジトリで darcs pull を実行すると upstreamの変更がmergeされる。
~/dbp/tokyocabinet-haskell$ darcs pull
Pulling from "/misc/home/takaki/dbp/tokyocabinet-haskell.upstream"...
Thu Apr 30 16:59:35 JST 2009 takaki@asis.media-as.org
* Imported tokyocabinet-haskell-0.0.4
into Darcs repository
Shall I pull this patch? (1/2) [ynWvplxdaqjk], or ? for help: y
Thu Apr 30 16:59:36 JST 2009 takaki@asis.media-as.org
tagged UPSTREAM_tokyocabinet-haskell_0.0.4
Shall I pull this patch? (2/2) [ynWvplxdaqjk], or ? for help: y
Finished pulling and applying.
~/dbp/tokyocabinet-haskell$
さて、このままでは deb としての変更は認識されていないので dch -v 0.0.4-1として新しいdebian/changelogのエントリーを追加する。dbp-buildpackageを実行したりしてパッケージのbuildのテストをしたりする。作業したあとにdarcs recordを適宜実行する。debのリビジョンとして区切りだなと思ったら darcs record と dbm-markdebを実行してtagを打つ。その繰り返しで進めていく。思ったより簡単だった。
メモ
間違えてdbp-markdebをやってしまったときにはdarcsのtagを削除するやりかたで普通にできる。
~/dbp/tokyocabinet-haskell$ darcs unrecord -t 'DEBIAN_tokyocabinet-haskell_0.0.4-1~2'
Thu Apr 30 17:11:37 JST 2009 takaki@asis.media-as.org
tagged DEBIAN_tokyocabinet-haskell_0.0.4-1~2
Shall I unrecord this patch? (1/1) [ynWvplxdaqjk], or ? for help: y
Finished unrecording.
~/dbp/tokyocabinet-haskell$
# いろいろ作業
~/dbp/tokyocabinet-haskell$ dbp-markdeb
Finished tagging patch 'TAG DEBIAN_tokyocabinet-haskell_0.0.4-1~2'
~/dbp/tokyocabinet-haskell$

Debian QA
Facebook (taniguchi.takaki)
Twitter (@takaki_t)