From owner-freebsd-ports@FreeBSD.ORG Tue Apr 13 21:22:39 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2859216A4CE for ; Tue, 13 Apr 2004 21:22:39 -0700 (PDT) Received: from gizmo08ps.bigpond.com (gizmo08ps.bigpond.com [144.140.71.18]) by mx1.FreeBSD.org (Postfix) with SMTP id A456343D54 for ; Tue, 13 Apr 2004 21:22:37 -0700 (PDT) (envelope-from andrew@areilly.bpc-users.org) Received: (qmail 12511 invoked from network); 14 Apr 2004 04:13:02 -0000 Received: from unknown (HELO psmam03.bigpond.com) (144.135.25.75) by gizmo08ps.bigpond.com with SMTP; 14 Apr 2004 04:13:02 -0000 Received: from cpe-138-130-186-193.nsw.bigpond.net.au ([138.130.186.193]) by psmam03.bigpond.com(MAM REL_3_4_2 89/12820642) with SMTP id 12820642; Wed, 14 Apr 2004 14:22:35 +1000 Received: (qmail 13397 invoked by uid 1000); 14 Apr 2004 04:22:33 -0000 Date: Wed, 14 Apr 2004 14:22:33 +1000 From: Andrew Reilly To: Garance A Drosihn Message-ID: <20040414042233.GA12776@gurney.reilly.home> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i cc: freebsd-ports@freebsd.org Subject: Re: Second "RFC" on pkg-data idea for ports X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2004 04:22:39 -0000 On Mon, Apr 12, 2004 at 11:40:59PM -0400, Garance A Drosihn wrote: > [this is BCC'ed to -hackers and -arch just so everyone has a > chance to see it, but I expect the bulk of the discussion > should take place on the freebsd-ports mailing list] > > Back in January I send out a long-ish email asking for feedback > on some ideas I had for the ports-collection. I received a fair > number of comments, and have finally re-organized my ideas into > a few web pages. Hopefully these will make more sense. Sorry, I think that I missed that RFC. Many of the "files" that are to be incorporated into this scheme (particularly patches) are things that are created as separate files, and must be passed as separate files into the patch program. So to a first degree of approximation, you're building an archiver. There are several archivers in the tree already (pax, tar, cpio, (zip is in ports, too)). Why not just use one of those? All of these have command line arguments to ennumerate the elements of the archive, and to extract specific items, even to extract to stdout, if you wish to send something to (for example) patch, without recreating the original directory tree. This works fine for variable values too: just use the envdir technique: one value per file. You don't need to flinch about wasted space or inodes, becuase you don't expect these things to be extracted into real file trees (although they could be for initial compatability). e.g. pkg-descr="$(unzip -qq -c foo.zip pkg-descr)" in sh or PORTVERSION!=unzip -qq -c foo.zip env/PORTVERSION in the Makefile. (Actually, you wouldn't do that at all, you'd do something more envdir-like, to set all of the "environment variable"-like values at once.) If you go with zip, you don't even have to worry about unnecessary levels of permission, because it doesn't have that... Since space is a consideration, you do get the advantage of automatic compression. And zip is widely available as a library with an easy API, if you want to build a fancier, all-singing port-maintenance application, like portupgrade. Cheers, -- Andrew