Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 14:50:26 -0500
From:      The Anarcat <anarcat@anarcat.dyndns.org>
To:        libh@FreeBSD.org
Cc:        Alexander Langer <alex@big.endian.de>
Subject:   Re: cvs commit: libh/include/sysinstall Database.hh libh/lib/sysinstall Database.cc Database.cd.cc
Message-ID:  <20020131195026.GC295@shall.anarcat.dyndns.org>
In-Reply-To: <200201311938.g0VJcSY49631@usw4.freebsd.org>
References:  <200201311938.g0VJcSY49631@usw4.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Alex, I send this to you just to drop a note that I committed the thing
as per your request (make the behavior overridable with a flag).

On Thu Jan 31, 2002 at 01:38:28PM -0600, Antoine Beaupré wrote:
> antoine     2002/01/31 13:38:28 CST
> 
>   Modified files:
>     include/sysinstall   Database.hh 
>     lib/sysinstall       Database.cc Database.cd.cc 
>   Log:
>   Implement auto database creation in Database TCL command
>   
>   This modifies the Database::open() command to add a flag which toggle
>   database creation.
>   
>   Database::create(string) is now deprecated since open() has the same
>   functionality. This commit doesn't remove it though.

Example use for dummies:

	[starting with no package database]
% Database 0
Cannot open database file /var/db/npkg/Packages-Name: No such file or directory
	[opening with no create flag fails, as old behavior]
% Database 1
0x836d0c8_8Database
	[db now created in default package dir]
% Database 0 ./npkg
Database lock failed: unable to open/create lock file ./npkg/lock: No such file or directory 
	[db not available in ./npkg]
% Database 1 ./npkg
0x836d048_8Database
	[db created in ./npkg]

Pretty simple. Works fine.

There's still the exception issue. The constructor, right now, will
interpret any runtime_error issued from Database::create() as a
"database missing" message. An exception could be created in
LanguageInterface.hh to handle exceptions particular to libh, since a
runtime_error can be generated from other parts and might not necessarly
mean that the db is missing. Ignoring the error in the Database
contructor would then be an error.

A.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjxZoAEACgkQttcWHAnWiGeESgCgnDC4D1tffjXzCZ2Pm5j4ClLg
QLAAn2llulwmd1x7I+reTPTgywCrXct5
=vuTN
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131195026.GC295>