Chinaunix

标题: pkg_mgr, a tool to manage and browse packages [打印本页]

作者: 剑心通明    时间: 2008-04-16 18:02
标题: pkg_mgr, a tool to manage and browse packages

Landry Breuil (landry@) sent us a note about his new project and the impact it may have for your everyday ports usage.
After using OpenBSD for a few years, I was still missing a higher-level tool to manage installed packages and browse available ones, but I didn't really like
pbrowser
, it was too tied to a graphical toolkit. I first started to look at a tool written by a friend,
pkg_select
, but its C code was hard to understand, and it was aimed at pkgsrc.
Then I remembered the existence of
sqlports
from Marc Espie (espie@) and found out that no one was using it. And as pkg_* tools are written in
Perl
(and I like Perl!), I decided to write my own
curses
-based tool on top of sqlports with Perl. I first tried to use one of the available ORM in the
ports-tree
(like
DBIx::Class
and
Rose::DB
), but found out that it was too slow for the few
SQL
queries I needed, so I ended writing my own plain
DBD::SQLite
model. I decided to strongly separate the interface from the model backend, so it would be easier to write an interface in something else that uses curses.
It quickly grew into something usable, and I rapidly added all the essential features I needed, but I kept it simple (atm it's only 650 lines of Perl). So here's for the story.. now
pkg_mgr
is a user-friendly graphical tool which allows you to manage installed packages, browse available packages by categories, and finally install/uninstall packages (using sudo, hence you don't need to run it as root). At the moment, only a simple curses interface is available, but a
Gtk2
GUI is planned soon. It is in no way intended to replace existing working tools, however it uses them extensively. It is just a more high-level interface to them (hence you'll need PKG_PATH set if you want to install packages). At the moment, you don't need the ports-tree installed to use it, but for future use it would be useful.

It relies on databases/sqlports for the internal database, so you will need to have an up-to-date version installed for pkg_mgr to work well.
e.g if you track -current, each time you update your ports-tree and packages, do something like this:  # pkg_add -ui -F installed sqlports
It uses Curses::UI, you will need a recent version of it (-current or 4.3 are okay, 4.2 or older are not because
Curses::UI
with dialog support is available only since a recent update. This limitation may disappear in the future)
If you only want to test it, you can install dependencies (pkg_add p5-Curses-UI p5-Curses p5-Term-ReadKey sqlports p5-DBD-SQLite), download source, untar it, and run it directly from source with ./pkg_mgr. Or just use the port which will be soon committed in
sysutils
.
I have lots of ideas for this new tool, but I need user feedback first, so I'd be happy to have comments and rants about it.
More information (source and screenshots) are available here;
http://gruiik.info/pkg_mgr.html
.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_544920.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2