From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 9 20:25:30 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 E243D106564A for ; Fri, 9 Apr 2010 20:25:30 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9D4F68FC17 for ; Fri, 9 Apr 2010 20:25:30 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 5so1219191qwi.7 for ; Fri, 09 Apr 2010 13:25:29 -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:content-type; bh=RVEUnTkXBAX8794OquU7X5lA/KpNbrEBUcBjozvDnpA=; b=vFRIj3fCNpJg6Xb+iKmYNuiqr03bPELlOzR3WaiWyoPJViZQ5jqOpdcxG4NNpnjoR5 gGXnc3g/DkNDwmKU3zteZdVAhmy03RFuIcgAaSQJPbUXbVFltc3B766NOEAnqc31LGXM RZT8j8oLi1L3uidyfmYCUMSE0eUGsMP5VJ6Bs= 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 :content-type; b=svogMK7iY8mXYQL3OTAOopKwuS69okLZQtAyMFoJ5gtgAocKcL0Zhjq8/2UYdP9Cmx pIoC26s/JngjcrTmDyJLmzkSv9ZCA4rU6/e1QimwF/FRkCwhtJ393D9vQqYJGSiAuI0Y jZ0UYgIvBv3AbKgVMAz0r+zXfN4Af8ReX+PPY= MIME-Version: 1.0 Received: by 10.229.33.72 with HTTP; Fri, 9 Apr 2010 13:25:29 -0700 (PDT) In-Reply-To: <20100409185150.GC61756@comcast.net> References: <20100409185150.GC61756@comcast.net> Date: Fri, 9 Apr 2010 13:25:29 -0700 Received: by 10.229.225.7 with SMTP id iq7mr663724qcb.26.1270844729327; Fri, 09 Apr 2010 13:25:29 -0700 (PDT) Message-ID: From: Garrett Cooper To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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: Fri, 09 Apr 2010 20:25:31 -0000 On Fri, Apr 9, 2010 at 11:51 AM, Charlie Kester wrote: > On Fri 09 Apr 2010 at 07:36:17 PDT 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 >>> >> >> Hi Leinier, >> >> 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. > > +1 > > It was a watershed moment in my programming career when I realized that > the bubbles on those DFD charts we used to use for structured design > could be whole processes and not just functions in a single, monolithic > program. > Suddenly everything the structured design folks were saying about > re-use, encapsulation, loose coupling, module cohesion, etc. made a lot > more sense when viewed from the perspective of simple Unix utilities > communicating with plain text via pipes. > We should encourage that approach as a default, and only put things into > binary libraries when forced to by performance considerations. It makes more sense here though because it can be used by the existing tools, it can be linked into other applications (that it makes sense to do so), like sysinstall (or its successor), and there's been some talk about splitting up pkg_install into two separate pieces, one for handling the low-level packaging tasks, and the other for handling the user-facing pieces. Thanks, -Garrett