From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 13 10:05:52 2010 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 3B919106564A; Tue, 13 Apr 2010 10:05:52 +0000 (UTC) (envelope-from alexanderchuranov@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id D036E8FC1C; Tue, 13 Apr 2010 10:05:51 +0000 (UTC) Received: by gwaa12 with SMTP id a12so3697292gwa.13 for ; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=denznh5xw8K479gWW+EptupUuvA0WTDUqW02xdztFzE=; b=jpO5n+4oW2Wm+YXR96h/FuB3jIzR4M9vzY1iBj893Twsx5H7/Q6xFOqR26P1CvImu3 suSSaKDd0U2WeA626lT3XR821YHYwJL0sjk6EuH9kifyyd7VHEQjdOaVWMNAUdNt4r0J W//4iq70mtsb8PrFJedZr42BXA6GZG1F1FLPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=g4oRF4LK7sYSAz1r9tun1jyb/Wgu0EDH1GuzO7iIo2E7LJ6cgsJIj+s5c5U5kQnPgC IqLL0WVObwgG/SFC4cHCJZdYJRZjilJcdlwTmXOmGn5AgoWLUV9f6nR8YQMKEIEZTU1F OpUnox9+QC3jqMGx6qzawrqf9bkK4oUF7QVhY= MIME-Version: 1.0 Received: by 10.90.119.15 with HTTP; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 14:05:51 +0400 Received: by 10.91.31.6 with SMTP id i6mr2510672agj.116.1271153151092; Tue, 13 Apr 2010 03:05:51 -0700 (PDT) Message-ID: From: Alexander Churanov To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers , Leinier Cruz Salfran Subject: Re: make pkg_install suite reusable, please 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: Tue, 13 Apr 2010 10:05:52 -0000 2010/4/11 Robert Watson > So I have no particular opinion on this tool, but I will say that in > general, it would be nice if programs were often thin wrappers around a > library that could be reused, not just command line tools. > > Robert > Robert, The reusable library is great. The question is how it works with the underlying system. When dealing with a package database, one may provide a library which directly reads and writes the database. On the other hand, the library may re-use some command-line tools. In the latter case there are chances for the package manipulating tool to stay consistent even if the memory in the calling process (which uses the library) is damaged. The database files are also less likely to became corrupted. Of course, run-time performance should be sacrificed. To summarize, there are two ways: 1) Provide the re-library and make command-line tools be just wrappers around the library. 2) Provide command-line tools and make the library to be just a wrapper around the tools. Approaches provide different trade-offs between run-time performance and isolation. Alexander Churanov