Debian

使用 git-dpm 來管理 Debian package中的 patch – 更新/升級 Debian 套件

前一篇文章介紹了如何透過 git-dpm 來新增 Debian 套件. 這一篇文章則是介紹如何在已存在的 Debian 套件中, 使用 git-dpm 的方式來進行更新/升級的動作.

1: 安裝必要套件
 apt-get install -y git git-dpm pristine-tar devscripts  
2: 準備好 upstream 的 tarball檔案

並命名為 <PACKAGENAME>_<UPSTREAM VERSION>.orig.tar.gz

  • PACKAGENAME: 為你要打包的套件名
  • UPSTREAM VERSION: 為上游版本號
3: 更新 upstream file
執行下列指令來更新套件原始碼
 git-dpm import-new-upstream --rebase ../<PACKAGENAME>_<UPSTREAM VERSION>.orig.tar.gz 
  • 如果 rebase 中間有錯誤, 請一一解決, 處理完執行下列指令, 直到排除所有衝突
 git rebase --continue  
最後執行下列指令來更新
 git-dpm update-patches 
4: 更新 debian/changelog
 dch −v newupstream−1 "New upstream version"
git commit −−amend −a 
5: 修改 debian/* 其他檔案
 git-dpm checkout-patched
vi ...
git commit
git-dpm update-patches 
6: 更新 pristine 檔案
 pristine-tar commit ../<PACKAGENAME>_<UPSTREAM VERSION>.orig.tar.gz upstream 
7: 確認 git-dpm status
 git-dpm status 
8: 確認套件可正常構建後, 幫 git-dpm 打 tag
 git-dpm tag 
9: 將修改結果 push 回去
git push --tags origin upstream:upstream pristine-tar:pristine-tar master

ref:

[1]: http://git-dpm.alioth.debian.org/examples.html#newupstream

[2]: https://anonscm.debian.org/git/collab-maint/cppman.git/

[3]: http://git-dpm.alioth.debian.org/git-dpm-debconf13.pdf

發表迴響