<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;First, get git and check it out like this:&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
$ git clone git://github.com/krh/razor.git&lt;br /&gt;
&lt;/pre&gt;&lt;br /&gt;
To compile it you&amp;#8217;ll need expat-devel, zlib-devel, libcurl-devel and rpm-devel (on Fedora), and then just type &amp;#8216;make&amp;#8217; to build it.&lt;/p&gt;
&lt;p&gt;Once it&amp;#8217;s built, you can type &amp;#8216;razor help&amp;#8217; to get a list of commands. The first couple of step you&amp;#8217;ll want to do is to import your system rpm database into a razor package set:&lt;/p&gt;
&lt;pre&gt;
$ ./razor import-rpmdb
&lt;/pre&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;
$ ls -lh system.repo 
-rw-r--r-- 1 krh krh 4.8M 2008-06-03 09:58 system.repo
&lt;/pre&gt;
&lt;p&gt;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()&amp;#8216;able and once you&amp;#8217;ve mapped it, you can start traversing the installed packages and dependencies without any initialization overhead.&lt;/p&gt;
&lt;p&gt;Next step is to do the same thing for the yum metadata:&lt;/p&gt;
&lt;pre&gt;
./razor import-yum
&lt;/pre&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;
$ ls -lh rawhide.repo 
-rw-rw-r-- 1 krh krh 45M 2008-06-03 10:03 rawhide.repo
&lt;/pre&gt;
&lt;p&gt;but this time it&amp;#8217;s a lot bigger since it holds metadata for all the packages available in fedora (around 9000).&lt;/p&gt;
&lt;p&gt;With these two repo files in place we can try asking what needs updating:&lt;/p&gt;
&lt;pre&gt;
$ ./razor update
...
&#65279;wrote system-updated.repo
&lt;/pre&gt;
&lt;p&gt;or ask to pull in a specific package:&lt;/p&gt;
&lt;pre&gt;
$ ./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
&lt;/pre&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Another thing to try out is installing packages.  Do&lt;/p&gt;
&lt;pre&gt;
$ ./razor init
&lt;/pre&gt;
&lt;p&gt;to initialize an install root in ./install, then try&lt;/p&gt;
&lt;pre&gt;
$ sudo ./razor install bash
&lt;/pre&gt;
&lt;p&gt;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.  &#65279;This part is a little rough still, it doesn&amp;#8217;t install the packages in the right order, but it basically works.&lt;/p&gt;
&lt;p&gt;Once it finishes, you can chroot into the install root to examine the install:&lt;/p&gt;
&lt;pre&gt;
$ sudo /usr/sbin/chroot install
&lt;/pre&gt;
&lt;p&gt;Finally, as a little show-off, you can try saying:&lt;/p&gt;
&lt;pre&gt;
$ source bash-completion.sh
&lt;/pre&gt;
&lt;p&gt;and then type&lt;/p&gt;
&lt;pre&gt;
$ ./razor list-requires gno&amp;lt;tab&amp;gt;&amp;lt;tab&amp;gt;
&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;
$ ./razor what-requires libex&amp;lt;tab&amp;gt;&amp;lt;tab&amp;gt;
&lt;/pre&gt;
&lt;p&gt;which demonstrates how razor is fast enough to list all packages, or all provides to be usable for tab completion.&lt;/p&gt;
&lt;p&gt;Anyway, hope that&amp;#8217;s enough to give you an idea of what&amp;#8217;s there and what it can do.  And if you want to dig deeper, there&amp;#8217;s only around 6000&lt;br /&gt;
lines of code, and razor.h is a good starting point.&lt;/p&gt;</body>
  <created-at type="datetime">2008-06-13T08:37:10-07:00</created-at>
  <id type="integer">26604</id>
  <permalink>getting-started</permalink>
  <repository-id type="integer">14128</repository-id>
  <title>Getting started</title>
  <updated-at type="datetime">2008-06-13T08:39:00-07:00</updated-at>
  <user-id type="integer">9175</user-id>
</wiki>
