Date: Fri, 09 May 2008 13:52:46 +0200 From: Anders Nore <andenore@start.no> To: freebsd-hackers@freebsd.org Subject: Adding .db support to pkg_tools Message-ID: <op.uavxx8ip2n4ijf@duckjen.nextgentel.no>
next in thread | raw e-mail | index | archive | help
Hi, 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. One problem lies with the +* files which is scripts (e.g., +INSTALL, +DEINSTALL). I've gotten some input that it's bad to save scripts in the db, but if it's not going to be saved there, then where? Isn't it possible to execute a script without saving a file to disk? Like using "sh -c 'string'". In my personal opinion it should not be a hybrid solution where you save the script files in an old fashion way, for example /var/db/pkg/someport-1.2_1/+INSTALL, and the rest of the information lies in the .db file. Because then you have redundancy and that could lead to inconsistencies. Let me hear your opinions =) - Anders Nore
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.uavxx8ip2n4ijf>