Baptiste Daroussin | 2 May 13:41 2012
Picon

Switching /etc/*.db from bdb to tinycdb

Hi,

I plan to work on switching all the /etc/*.db files from bdb 1.85 to cdb (using
the tinycdb implementation)

Reason for doing that:
1/ we use the *.db files as a constant database on recreating them using
*_mkdb(8) commands
2/ bdb 1.85 database are endianness dependant which can cause problem if I want
pkgng to be able to create users when cross installing packages (like adding
packages in a mips eb chroot environment on an amd64 host)
3/ the tinycdb API is clean and easy to use (I find it easier and cleaner to
deal with it)
4/ tinycdb is public domain so not problem for us to use it.

On the side effects, I'm not sure this is relevant but tinycdb is also faster to
read then bdb 1.85.

How do I plan to do it.

I plan to import the read part or tinycdb into libc and the write part into
libutil (to avoid cluttering libc).

Why importing to libc? to allow all the get*ent to parse the /etc/*.db files.

How to implment it? slowly with backward compatibility:
for each kind of files: try to open with cdb, if fail fall back to bdb.

I plan to rewrite all the *_mkdb for make them use cdb.

(Continue reading)

Luigi Rizzo | 2 May 14:26 2012
Picon
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 2, 2012 at 1:41 PM, Baptiste Daroussin <bapt <at> freebsd.org> wrote:

> Hi,
>
> I plan to work on switching all the /etc/*.db files from bdb 1.85 to cdb
> (using
> the tinycdb implementation)
>
> Reason for doing that:
> 1/ we use the *.db files as a constant database on recreating them using
> *_mkdb(8) commands
> 2/ bdb 1.85 database are endianness dependant which can cause problem if I
> want
> pkgng to be able to create users when cross installing packages (like
> adding
> packages in a mips eb chroot environment on an amd64 host)
> 3/ the tinycdb API is clean and easy to use (I find it easier and cleaner
> to
> deal with it)
> 4/ tinycdb is public domain so not problem for us to use it.
>
> On the side effects, I'm not sure this is relevant but tinycdb is also
> faster to
> read then bdb 1.85.
>
> How do I plan to do it.
>
> I plan to import the read part or tinycdb into libc and the write part into
> libutil (to avoid cluttering libc).
>
(Continue reading)

Baptiste Daroussin | 2 May 14:31 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 02:26:36PM +0200, Luigi Rizzo wrote:
> On Wed, May 2, 2012 at 1:41 PM, Baptiste Daroussin <bapt <at> freebsd.org> wrote:
> 
> > Hi,
> >
> > I plan to work on switching all the /etc/*.db files from bdb 1.85 to cdb
> > (using
> > the tinycdb implementation)
> >
> > Reason for doing that:
> > 1/ we use the *.db files as a constant database on recreating them using
> > *_mkdb(8) commands
> > 2/ bdb 1.85 database are endianness dependant which can cause problem if I
> > want
> > pkgng to be able to create users when cross installing packages (like
> > adding
> > packages in a mips eb chroot environment on an amd64 host)
> > 3/ the tinycdb API is clean and easy to use (I find it easier and cleaner
> > to
> > deal with it)
> > 4/ tinycdb is public domain so not problem for us to use it.
> >
> > On the side effects, I'm not sure this is relevant but tinycdb is also
> > faster to
> > read then bdb 1.85.
> >
> > How do I plan to do it.
> >
> > I plan to import the read part or tinycdb into libc and the write part into
> > libutil (to avoid cluttering libc).
(Continue reading)

Dag-Erling Smørgrav | 2 May 14:57 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

Baptiste Daroussin <bapt <at> FreeBSD.org> writes:
> I plan to import the read part or tinycdb into libc and the write part into
> libutil (to avoid cluttering libc).

I would prefer having everything in one place.

DES
--

-- 
Dag-Erling Smørgrav - des <at> des.no
_______________________________________________
freebsd-arch <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe <at> freebsd.org"

Baptiste Daroussin | 2 May 15:02 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 02:57:07PM +0200, Dag-Erling Smørgrav wrote:
> Baptiste Daroussin <bapt <at> FreeBSD.org> writes:
> > I plan to import the read part or tinycdb into libc and the write part into
> > libutil (to avoid cluttering libc).
> 
> I would prefer having everything in one place.
> 

Ok I'll do that way.

Bapt
Luigi Rizzo | 2 May 16:02 2012
Picon
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 02:31:49PM +0200, Baptiste Daroussin wrote:
...
> > > Why importing to libc? to allow all the get*ent to parse the /etc/*.db
> > > files
> > >
> > 
> > just curious, where do we have  the bdb 1.85 routines now ?
> > Are they all in libc, or split between libc and libutil ?
> 
> All in libc

ok then it makes sense to preserve the structure and have
everything in libc as des suggested. Just a curiosity again,
any estimate of code size ?

cheers
luigi
_______________________________________________
freebsd-arch <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe <at> freebsd.org"

Baptiste Daroussin | 2 May 15:45 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 04:02:35PM +0200, Luigi Rizzo wrote:
> On Wed, May 02, 2012 at 02:31:49PM +0200, Baptiste Daroussin wrote:
> ...
> > > > Why importing to libc? to allow all the get*ent to parse the /etc/*.db
> > > > files
> > > >
> > > 
> > > just curious, where do we have  the bdb 1.85 routines now ?
> > > Are they all in libc, or split between libc and libutil ?
> > 
> > All in libc
> 
> ok then it makes sense to preserve the structure and have
> everything in libc as des suggested. Just a curiosity again,
> any estimate of code size ?
> 

That is pretty small:
     545 cdb.c
      76 cdb_find.c
      81 cdb_findnext.c
      19 cdb_hash.c
     113 cdb_init.c
     184 cdb_make.c
      50 cdb_make_add.c
     204 cdb_make_put.c
     100 cdb_seek.c
      29 cdb_seq.c
      18 cdb_unpack.c
     126 cdb.h
(Continue reading)

Dag-Erling Smørgrav | 2 May 16:13 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

Baptiste Daroussin <bapt <at> freebsd.org> writes:
> That is pretty small:
>      545 cdb.c
>       76 cdb_find.c
>       81 cdb_findnext.c
>       19 cdb_hash.c
>      113 cdb_init.c
>      184 cdb_make.c
>       50 cdb_make_add.c
>      204 cdb_make_put.c
>      100 cdb_seek.c
>       29 cdb_seq.c
>       18 cdb_unpack.c
>      126 cdb.h
>       41 cdb_int.h
>     1586 total

kB or LOC?

DES
--

-- 
Dag-Erling Smørgrav - des <at> des.no
_______________________________________________
freebsd-arch <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe <at> freebsd.org"

Baptiste Daroussin | 2 May 16:21 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 04:13:49PM +0200, Dag-Erling Smørgrav wrote:
> Baptiste Daroussin <bapt <at> freebsd.org> writes:
> > That is pretty small:
> >      545 cdb.c
> >       76 cdb_find.c
> >       81 cdb_findnext.c
> >       19 cdb_hash.c
> >      113 cdb_init.c
> >      184 cdb_make.c
> >       50 cdb_make_add.c
> >      204 cdb_make_put.c
> >      100 cdb_seek.c
> >       29 cdb_seq.c
> >       18 cdb_unpack.c
> >      126 cdb.h
> >       41 cdb_int.h
> >     1586 total
> 
> kB or LOC?

LOC
Konstantin Belousov | 2 May 16:47 2012
Picon

Re: Switching /etc/*.db from bdb to tinycdb

On Wed, May 02, 2012 at 03:45:47PM +0200, Baptiste Daroussin wrote:
> On Wed, May 02, 2012 at 04:02:35PM +0200, Luigi Rizzo wrote:
> > On Wed, May 02, 2012 at 02:31:49PM +0200, Baptiste Daroussin wrote:
> > ...
> > > > > Why importing to libc? to allow all the get*ent to parse the /etc/*.db
> > > > > files
> > > > >
> > > > 
> > > > just curious, where do we have  the bdb 1.85 routines now ?
> > > > Are they all in libc, or split between libc and libutil ?
> > > 
> > > All in libc
> > 
> > ok then it makes sense to preserve the structure and have
> > everything in libc as des suggested. Just a curiosity again,
> > any estimate of code size ?
> > 
> 
> That is pretty small:
>      545 cdb.c
>       76 cdb_find.c
>       81 cdb_findnext.c
>       19 cdb_hash.c
>      113 cdb_init.c
>      184 cdb_make.c
>       50 cdb_make_add.c
>      204 cdb_make_put.c
>      100 cdb_seek.c
>       29 cdb_seq.c
>       18 cdb_unpack.c
(Continue reading)


Gmane