Subject: Re: Changes to reference count directories
To: Greg Troxel <gdt@ir.bbn.com>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 01/26/2005 10:41:18
Greg Troxel wrote:
> It would be really nice to have
> 
>   pkg_admin check-dirs
> 
> be able to grovel over /var/db/pkg, and for each dir count how many
> packages require it, compare that to the refcount, and fix the
> refcount.  This will enable both recovery and checking the recount
> invariant.  I'm pessimistic enough that I believe unless invariants
> are checked there will be bugs that lead to them being violated.

One of the goals of the implementation is that this type of invariant
checking can be done easily.  The way the refcount database is kept will
facilitate adding commands to pkg_admin to (1) check that the database
is consistent, and (2) repair the directory structure and the database
if necessary.  I intend to make these changes to pkg_admin after several
other changes are completed.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>