- 论坛徽章:
- 0
|
本帖最后由 zeissoctopus 于 2011-10-22 23:29 编辑
2011 DevSummit 與 EuroBSDcon 2011 已順利完成今年有很多新點子,本篇試一試翻譯一篇有關 pkgng
pkgng 將會是未來 FreeBSD 的 apt 或 yum
的確令人期待
原文 pdf 網址: http://wiki.freebsd.org/201110DevSummit/Ports?action=AttachFile&do=view&target=pkgng-devsummit.pdf
活動 FreeBSD Developer Summit, EuroBSDcon 2011, Maarssen, The Netherlands
日期 2011 年 10 月 8 日
作者 Baptiste Daroussin (bapt@FreeBSD.org)
請尊重原作者一切版權的權利
Why changing 為何要轉變?
原因一: /usr/src/usr.sbin/pkg_install/add/perform.c 源碼中早已注明
- /*
- * This is seriously ugly code following. Written very fast!
- * [And subsequently made even worse.. Sigh! This code was just born
- * to be hacked, I guess.. :) -jkh]
- */
- /*
- * 以下是一段非常草率程式碼,過急地被編寫而成,可能令事情變成更差
- * 我認為這段由一開始便需要被 hack -jkh (Jordan K. Hubbard)
- */
复制代码 原因二: /usr/src/usr.sbin/pkg_install/delete/perform.c 源碼也早已注明
- /* This is seriously ugly code following. Written very fast! */
- /* 以下是一段非常草率程式碼,過急地被編寫而成 */
复制代码 原因三: no safe upgrade possible
現在的 pkg_* 沒有可能安全昇級(軟體)
原因四:no clean repository handling
現在的 pkg_* 沒有明晰的 repository 處理機制
原因五:hardly extensible
現在的 pkg_* 機乎不可能有擴展性
原因六:lack features provided by ports
現在的 pkg_* 缺乏了 ports 提供的特色(功能)
原因七:lack features to help improving ports
現在的 pkg_* 缺乏特色(功能)去幫助改善 ports
What is pkgng pkgng 是什麼東西?
binary package managment tool (ala apt/yum)
它是二進碼程式打包管理工具 (正如 apt 或 yum)
library to handle packages (libpkg)
它有一個管理二進碼程式打包管理的函式庫 (libpkg)
very simple and powerful default UI (pkg)
它有一個非常單簡而有力的預設使用者介面 (pkg)
new binarg package format
它制定一個全新的二進碼打包格式準則
fully compatible with ports
它可以完全兼容 ports (二者可以交互使用而不引起衝突)
easy manual package creation
使用它可以很容易 DIY 包打軟體
safe upgrade possible
使用它,軟件安全升級變成有可能的事了
Binary management? 如何二進碼打包管理?
updating the repository informations - 更新 repository 資訊
- $ pkg update
- http://pkggng.etoilebsd.net/eeepc/repo.txz 100% 157KB 157.KB/s 157KB/s 00:00
复制代码 upgrading 更新軟件installing 安裝指定軟件
- $ pkg install libreoffice
复制代码 cleaning 刪除軟件searching for remote packages - 尋找遠端軟件包
- $ pkg search chromium
- chromium-13.0.782.215: A mostly BSD-licensed web browser based on WebKit and Gtk+
复制代码 What else ? pkgng 還有其他(功能)?
register an alreadly installed port - 註冊一個剛才使用 ports 來安裝的軟件入 pkgng 管理系統query information from installed packages - 查詢所有已安裝的軟件包之資訊(有二種取向)
user friendly query: 取悅使用者的查詢方法script firendly query: 取悅手稿的查詢方法
- $ pkg query "I am %n version %v" chromium
- I am chromium version 13.0.782.215
复制代码 native support for jail and chroot - 原生支援 jail 和 chroot
- $ pkg -j myjailname info -a
- $ pkg -c /path/to/my/chroot info -a
复制代码 experimental multi repositories support - 實驗性支援同時多過一個 repositories
New package format 全新的二進碼軟件打包格式
more metadata 更多 metadata 資訊
- $ pkg search -f chromium
- Name : chromium
- Version : 13.0.782.215
- Origin : www/chromium
- Prefix : usr/local
- Categories : www
- Licenses : MPL | LGPL21 | BSD
- Maintainer : chromium@FreeBSD.org
- WWW : http://www.chromium.org/Home
- Comment : A mostly BSD-licensed web browser based on WebKit and Gtk+
- Options :
- CODECS: on
- GCONF: on
- VPX: on
- Flat size : 74 MB
- Pkg size : 19 MB
- Description :
- chromium is an open-source browser project that aims to build a safer,
- faster, and more stable way for all users to experience the web.
- The Chromium website contains design documents, architecture overviews,
- testing information, and more to help you learn to build and work with
- the Chromium source code.
- WWW: http://www.chromium.org/Home
复制代码 a single serialisable manifest (YAML) 這新格式是一種單數序性清單(YAML)
full path files 這新格式有完整路徑檔案
upgrade scripts 這新格式有更新手稿碼
libpkg 函式庫
simple and consistent API 簡單而一致性的 API
event driven messages 事件驅動的信息
full featured: 完整特色功能:
- everything to deal with packages 一切處理軟件打包的功能
- everything to create packages 一切產生軟件打包的功能
- everything to deal with repositories 一切處理 repositories 功能
- everything to create repositories 一切產生 repositories 功能
easy-to-write binding (experimental lua) 容易編寫連結 libpkg 的程式 (實驗 lua 支援 libpkg)
easy to use 容易使用
- create.c 158 行
- install.c 132 行
- upgrade.c 123 行
Thread safe
clean and simple code base 清楚和簡單源碼思路為基礎
easily extensible 很容易地擴展它的功能
New local database 全新的本地數據庫
uses SQLite to store anything 使用 SQLite 儲存 pkgng 任何東西
- reliable 因此 libpkg 可靠
- transactions 因此 libpkg 具備事務特性
- ACID -libpkg 具備 ACID 完整邏輯事務特性
high level language libpkg 是一種高階程式語言
fast - libpkg 執行速度快
New remote(s) database 全新遠端一個或多個數據庫
uses SQLite to store anything but files 使用 SQLite 儲存一切資訊但不包括檔案
- can be signed using RSA (SHA256) 可以用 RSA 來簽署 (SHA256 加密)
- tar using xz compression (small size) 用 tar 作 xz 解縮 (相對較少身段)
planed an optional files database 計劃了附加的檔案數據庫
easy to create: 容易創造一個 repostry
- $ pkg repo my_folder [my_rsa_key]
复制代码
Compatibility with ports 與 ports 並存的兼容性
work out of the box with 95% of the ports tree 一開始便可以順利使用 95% ports
all the magic is in bsd.pkgng.mk 一切功能寫在 /usr/ports/Mk/bsd.pkgng.mk 中
what is not working 那些 ports 不能使用 pkgng 安裝?
- @exec/unexec in the middle of the plist - 當 ports 的 @exec/unexec 是放在 plist 檔案的中間
- non sh scripts - 當 ports 不是使用 sh 手稿
- buggy plist that are now detected - 發現 plist 沖積錯誤碼
what works 那些 ports 可以使用 pkgng 安裝?
除了以上指出那些不能用的 ports 外,其他 ports 皆可以與 pkgng 混合用
Open tasks 未完成的工作
- Safer for installation / upgrades 加強安裝或更新軟件時的安全性
- detect upspecified conflicts early 提早發現軟件們相衝突
- better ordering of the packages 更有效地把軟件排序
- code review, in particular the SSL usage 審閱 pkgng 程式碼,尤其是有關使用 SSL
- capsicum 增加支援 capsicum
- may be a pkg rquery 或許實現反向查詢 pkg rquery
- packagekit backend 實現 packagekit 為後置的 pkgng
- write a migration plan! 編寫一個轉移計劃
PKGNG:Thanks 謝謝
http://wiki.freebsd.org/pkgng
https://github.com/pkgng/pkgng |
评分
-
查看全部评分
|