Home Getting Started FAQ Razor Design The Big Plan

Getting started

First, get git and check it out like this:

$ git clone git://github.com/krh/razor.git

To compile it you'll need expat-devel, zlib-devel, libcurl-devel and rpm-devel (on Fedora), and autoconf, automake, libtool, and intltool. Then run ./autogen.sh to generate all the autotools files and when that finishes, just type 'make' to build it.

Once it's built, you can type 'razor help' to get a list of commands. The first couple of step you'll want to do is to import your system rpm database into a razor package set:

$ ./razor import-rpmdb

This wont affect your system rpm database, it will just use rpmlib to query the installed packages on your system and output system.repo file:

$ ls -lh system.repo 
-rw-r--r-- 1 krh krh 4.8M 2008-06-03 09:58 system.repo

This is a razor-specific, binary file format. It represents all the installed packages on your system and their dependencies. Razor gets much of its speed from the way it works with these files; it is directly mmap()'able and once you've mapped it, you can start traversing the installed packages and dependencies without any initialization overhead.

Next step is to do the same thing for the yum metadata:

./razor import-yum

This will take a little longer because it needs to download and convert the yum metadata, but the output is the same type of file:

$ ls -lh rawhide.repo 
-rw-rw-r-- 1 krh krh 45M 2008-06-03 10:03 rawhide.repo

but this time it's a lot bigger since it holds metadata for all the packages available in fedora (around 9000).

With these two repo files in place we can try asking what needs updating:

$ ./razor update
...
wrote system-updated.repo

or ask to pull in a specific package:

$ ./razor update system-config-network
Installing system-config-network 1.5.10-1.fc9
Installing system-config-network-tui 1.5.10-1.fc9 for
system-config-network, which requires system-config-network-tui =  1.5.10-1.fc9
wrote system-updated.repo

in both cases razor writes out system-update.repo, which is another repo file which represents the packages in system.repo, but with the specified packages replaced.

Another thing to try out is installing packages. Do

$ ./razor init

to initialize an install root in ./install, then try

$ sudo ./razor install bash

which will install bash and required packages into the install root. sudo is necessary here because we need to chroot into the install root when running the install scripts. This part is a little rough still, it doesn't install the packages in the right order, but it basically works.

Once it finishes, you can chroot into the install root to examine the install:

$ sudo /usr/sbin/chroot install

Finally, as a little show-off, you can try saying:

$ source bash-completion.sh

and then type

$ ./razor list-requires gno[tab][tab]

or

$ ./razor what-requires libex[tab][tab]

which demonstrates how razor is fast enough to list all packages, or all provides to be usable for tab completion.

Anyway, hope that's enough to give you an idea of what's there and what it can do. And if you want to dig deeper, there's only around 6000 lines of code, and razor.h is a good starting point.