From owner-freebsd-hackers@FreeBSD.ORG Fri May 9 12:43:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 643E91065674 for ; Fri, 9 May 2008 12:43:07 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.pkgsrc-box.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id 179358FC1A for ; Fri, 9 May 2008 12:43:07 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (www.pkgsrc-box.org [127.0.0.1]) by www.pkgsrc-box.org (Postfix) with ESMTP id C5DFAE506AA for ; Fri, 9 May 2008 12:43:05 +0000 (UTC) Received: by britannica.bec.de (Postfix, from userid 1000) id 4400316FC2; Fri, 9 May 2008 14:43:09 +0200 (CEST) Date: Fri, 9 May 2008 14:43:08 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20080509124308.GA596@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: Adding .db support to pkg_tools X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 May 2008 12:43:07 -0000 On Fri, May 09, 2008 at 01:52:46PM +0200, Anders Nore wrote: > I'm working on adding .db support to the pkg_tools( i.e. pkg_add, pkg_info, > etc. ) as part of SoC 2008. The database api used is BerkeleyDB that comes > with the base system (/usr/src/include/db.h). BerkeleyDB is not you're > typical relational db, and can only save key/value pairs. The way I'm > thinking of storing information to the .db is to name the keys as the > directory names in /var/db/pkg. And save the +* files in the directories to > the value element in the db, separated with a special character or similar. As one of the persons hacking on pkg_install in pkgsrc/NetBSD, I would *strongly* advisy you against storing the files only in a bdb file. The change of major and complete corruption with bdb185 is high, consider pulling the plug in the middle of a long update. Secondly, I would also advisy against just storing all meta data in a single key/value pair. For example, +CONTENTS can be extremely large. Check texmf for a good example. Joerg