From owner-freebsd-libh Thu Jan 31 11:50:32 2002 Delivered-To: freebsd-libh@freebsd.org Received: from tomts12-srv.bellnexxia.net (tomts12.bellnexxia.net [209.226.175.56]) by hub.freebsd.org (Postfix) with ESMTP id 9879537B400 for ; Thu, 31 Jan 2002 11:50:25 -0800 (PST) Received: from khan.anarcat.dyndns.org ([65.94.186.7]) by tomts12-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20020131195024.XTPA9396.tomts12-srv.bellnexxia.net@khan.anarcat.dyndns.org>; Thu, 31 Jan 2002 14:50:24 -0500 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 0C026195D; Thu, 31 Jan 2002 14:50:20 -0500 (EST) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id 78E7620ACC; Thu, 31 Jan 2002 14:50:27 -0500 (EST) Date: Thu, 31 Jan 2002 14:50:26 -0500 From: The Anarcat To: libh@FreeBSD.org Cc: Alexander Langer 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> References: <200201311938.g0VJcSY49631@usw4.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3Pql8miugIZX0722" Content-Disposition: inline In-Reply-To: <200201311938.g0VJcSY49631@usw4.freebsd.org> User-Agent: Mutt/1.3.25i Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --3Pql8miugIZX0722 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=E9 wrote: > antoine 2002/01/31 13:38:28 CST >=20 > Modified files: > include/sysinstall Database.hh=20 > lib/sysinstall Database.cc Database.cd.cc=20 > Log: > Implement auto database creation in Database TCL command > =20 > This modifies the Database::open() command to add a flag which toggle > database creation. > =20 > 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 direc= tory [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=20 [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. --3Pql8miugIZX0722 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjxZoAEACgkQttcWHAnWiGeESgCgnDC4D1tffjXzCZ2Pm5j4ClLg QLAAn2llulwmd1x7I+reTPTgywCrXct5 =vuTN -----END PGP SIGNATURE----- --3Pql8miugIZX0722-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message