swim - chapter 5
MAKING INSTALLED SYSTEM DATABASES


5.1 Initial database making, and Rebuilding for an Installed system.

usage: swim --initdb       
       swim --rebuilddb

options:  [--dbpath <dir>] [--root <dir>] [--lowmem]  
          [--split_data <lines>]

An installed Debian distribution is one in which packages are installed using dpkg or some front-end to dpkg like apt or dselect; swim supports installation through apt. These major modes are for a computer with an installed Debian distribution and make the databases which allow querying and searching capabilities for the installed distribution.

--initdb is run when the databases do not exist yet, --rebuilddb is run if the databases have become corrupt, or you want to rebuild the databases instead of updating them.

--dbpath can be specified as an alternative location for where the databases will be made. The default location is ``/var/lib/dpkg''. An argument like ``/otherstuff'' could be provided, and then the databases would be made here instead.

--root allows a database to be made for a Debian distribution installed on a different partition. If the distribution is mounted on /New_Debian, ``/New_Debian'' would be the argument to root. The databases would be made for the Debian distribution installed on the ``/New_Debian'' partition.

--dbpath and --root can be used together. Given the previous two examples, the databases would be made on ``/New_Debian/otherstuff'', assuming ``/New_Debian/otherstuff'' actually existed.

--lowmem uses a method which uses a small amount of memory to make the databases. By default --initdb and --rebuilddb use a method which fully takes advantage of memory, this is a good thing, because it means the databases are made in a quicker manner. On a computer with a K6-200 CPU, 64MB of memory, and 1500 installed packages, the databases can be made in 4.5 minutes using the default method, and 11 minutes using the low memory method. The high memory method is the default because in general the size of a distribution is related to how much resources a computer has, and probably a large installation is unusual. If you get an ``out of memory'' when you use the default method, or if your system is overloaded to begin with, the --lowmem method is the prefered way.

--split_data determines the size of the files in the temporary directory used to contruct the database. The default is 25000 lines per file. If you are using the --lowmem method you may want to provide a different argument to --split_data, like ``--split_data 10000''. This is a subject of experimentation.


5.2 UPDATING

usage: swim --db

options: [--dbpath <dir>] [--root <dir>] [--check]

--db allows you to update the databases by hand when packages have been removed, added, or changed. swim will automatically run --db under certain conditions.

--check prints out the changes to STDERR, and the total to STDOUT without proceeding with the update.

See Initial database making, and Rebuilding for an Installed system. , section 5.1 for options --dbpath and --root.


5.3 REBUILDING THE SEARCH

usage: swim --rebuildflatdb

options: [--dbpath <dir>] [--root <dir>]

swim makes the flat databases searchindex.deb and dirindex.deb for doing powersearches. Instead of rebuilding these databases everytime --db is run, new information is just appended to these databases, and old information is kept. Generally, this is not a problem because only files and directories which the other databases actually know something about will be refered to. But in a situation where a file has changed into a directory, the powersearch may not work properly, because the old file name remains in searchindex.deb, and the new directory name is now in dirindex.deb directory. In general, it takes a lot of changes to the installed system before it is really becomes necessary to rebuild the flat databases. This process takes less than a minute on a K6-200 with 1500 packages.

See Initial database making, and Rebuilding for an Installed system. , section 5.1 for options --dbpath and --root.


5.4 FILES

Databases which are made:

 packages.deb
 fileindex.deb
 statusindex.deb
 groupindex.deb
 searchindex.deb
 dirindex.deb

swim - Copyright © 1999 Jonathan D. Rosenbaum
Contents; next; back.
15 June 1999
Jonathan D. Rosenbaummttrader@access.mountain.net