From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 11 11:37:27 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 F04FC106564A for ; Sun, 11 Apr 2010 11:37:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C6E538FC1A for ; Sun, 11 Apr 2010 11:37:27 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 7908E46B6C; Sun, 11 Apr 2010 07:37:27 -0400 (EDT) Date: Sun, 11 Apr 2010 12:37:27 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Churanov In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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: Sun, 11 Apr 2010 11:37:28 -0000 On Fri, 9 Apr 2010, Alexander Churanov wrote: > 2010/4/9 Leinier Cruz Salfran > >> i want to ask you one thing: can you make the 'pkg_install' suite reusable >> .. means install 'libinstall.a' as a shared object in order to make it >> reusable by others devs > > I'd like to add my 50 cents. From my point of view, the true UNIX way is > re-using whole programs. This provides unbelievable isolation and > correctness. If you don't want to fork myriads of processes each second, > then, it's, probably, better to ask for pipe mode of pkg_* tools. For > example, aspell works that way. You start a process, write commands and > queries and read results. While there are clearly benefits to process isolation, there are countless situations in UNIX where I've said to myself "Oh, I wish I had a lib not just a command". This is particularly the case for monitoring tools, where third-party applications have a lot of trouble parsing and tracking the output of tools like ps(1), etc. This is why recently we've been working on libmemstat(3), libprocstat(3), libnetstat(3), etc -- so that tools can avoid rewriting that code as well as avoid the parsing problem. 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