DragonFly BSD

rpkgmanager

Introduction

rpkgmanager is a simple way of installing and keeping your packages updated. It builds from source and uses what pkgsrc tree you have checked out in /usr/pkgsrc. It is based around a list with packages that you wish to have installed. rpkgmanager is written in ruby.

Setting it up

Begin by installing lang/ruby, pkgtools/p5-pkgsrc-Dewey, installing the needed gem and cloning the rpkgmanager git repo:

# pkg_radd ruby p5-pkgsrc-Dewey
# gem19 install open4
> git clone git://gitorious.org/rpkgmanager/rpkgmanager.git && cd rpkgmanager

Now it's time to set up wanted.db, the file that holds all packages you want installed. There is a sample wanted.db file in your checked out directory. This is what I use:

devel/mercurial,42
devel/scmgit,42
devel/subversion-base,42
lang/kaffe,41
lang/pcc-current,42
lang/ruby,42
mail/mutt-devel,42
mail/offlineimap,42
misc/screen,42
multimedia/mplayer,42
net/avahi,42
net/netatalk,42
net/nmap,42
net/rsync,42
net/rtorrent,42
pkgtools/p5-pkgsrc-Dewey,42
security/sudo,42
sysutils/cdrtools,42
sysutils/smartmontools,42
wip/jdk16,42
www/apache22,42
www/apache-tomcat6,42
www/curl,42
www/links,42

The number after the comma tells rpkgmanager in which order to install/upgrade the packages. I usually don't care and put the same priority on all packages, except for wip/jdk16 that needs lang/kaffe to bootstrap.

Using it

Running rpkgmanager may take some time depending on how many packages you install. It has to gather information on everyone of them. It will ask the simple Yes or No question when done. Remember that it will want to remove all packages that are not in your wanted.db file or not dependencies of those packages.

To run it, just execute the ruby file.

# ./rpkgmanager.rb

I've set it up to run every night answering No to the proceed question, just to see what it wants to do. Add this to your /etc/crontab:

0 3 * * * root cd /usr/pkgsrc && git pull && echo n | /home/luxh/bin/rpkgmanager.rb

Remember to add /usr/pkg/bin to your crontabs's $PATH if you don't already have it there.

Then in the morning when you've read the night's logs and wish to upgrade your packages:

# yes | rpkgmanager.rb

More information

Read the manpage in your checked out copy of the repo, rpkgmanager(8)

> cd rpkgmanager && man ./rpkgmanager.8