From owner-p4-projects@FreeBSD.ORG Thu Apr 15 08:51:31 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4C96B1065672; Thu, 15 Apr 2010 08:51:31 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC292106564A; Thu, 15 Apr 2010 08:51:30 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gx0-f214.google.com (mail-gx0-f214.google.com [209.85.217.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7699B8FC13; Thu, 15 Apr 2010 08:51:30 +0000 (UTC) Received: by gxk6 with SMTP id 6so668827gxk.14 for ; Thu, 15 Apr 2010 01:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=PMeGka+pbhBhBX49OFBFaf9Qdv1Sxtyd0hyPz6Gcb88=; b=b/U+QmieNtr/vUUcqKSC3P/V0i1q+wqQ7p1A6SR3j0BBewgq6BntDSx3KL68j82r/n JFIgILBoB/COCThcSJIyy+NJB7zx1qJLTX8gE3C3PuPogNzCLMaDDXSo7mvR5eNSPCmY h1sJkb/ZxM7I7++5y6G2CZkI3pqU1Vw/ULcyY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ZVrKi2T1AHsctToCV5hqjA0uMNBA0IHdlFG7rRZkJSd3DDo2Kew8hLOHNfgXTybYVE BqP4LO1x6bj9mArXqrZrywFhKGNp2el4mTFTkrU72tSmY7VfBYUopf4AYdRRp8lryRnJ Winy6uLhi0rDwWsB/EPy/Rd7uFvCqp5SSEJpE= MIME-Version: 1.0 Sender: yanegomi@gmail.com Received: by 10.231.183.17 with HTTP; Thu, 15 Apr 2010 01:51:29 -0700 (PDT) In-Reply-To: <4BC5DCDD.2060902@freebsd.org> References: <201004121230.o3CCUsIX029146@repoman.freebsd.org> <4BC3EB5B.5070801@freebsd.org> <4BC53714.80805@freebsd.org> <4BC5DCDD.2060902@freebsd.org> Date: Thu, 15 Apr 2010 01:51:29 -0700 X-Google-Sender-Auth: 1d8a43f14689ceea Received: by 10.150.128.36 with SMTP id a36mr19434ybd.337.1271321489689; Thu, 15 Apr 2010 01:51:29 -0700 (PDT) Message-ID: From: Garrett Cooper To: Tim Kientzle Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: David Forsythe , Perforce Change Reviews , Florent Thoumie Subject: Re: PERFORCE change 176831 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 08:51:31 -0000 On Wed, Apr 14, 2010 at 8:18 AM, Tim Kientzle wrote: >>>>> But I really do believe that single-pass direct >>>>> install is feasible and is eventually where we want >>>>> to be. =A0The key insight for me was when Florent recently >>>>> pointed out that you could just read the +CONTENTS, >>>>> then do a verify pass, then extract everything. >>>>> (Any conflict during the extraction pass >>>>> would be a fatal error: =A0delete everything >>>>> extracted so far and scream loudly.) > >>>> Agreed on the final point. I'm kind of interested though about the >>>> first point -- the verify pass -- are you verifying that the contents >>>> are sane on the disk or in the tarball? If so, why not just verify the >>>> contents after the fact... > > That is: > =A0* Read and parse +CONTENTS Ok. > =A0* Check the package database to verify that > =A0 =A0dependent packages exist and that no conflicting > =A0 =A0packages exist. =A0If there's a problem, ask the > =A0 =A0user what to do. =A0(This gets complicated.) I'm not going to complicate this. If there's a conflict, I'll have the app exit like it always has so the user can consider his/her next move. User input will only serve to complicate the goal behind pkg_install, which is to install packages as functional and timely as possible. > =A0* Check the disk to verify that none of the files > =A0 =A0listed in +CONTENTS already exist on disk. =A0If so, > =A0 =A0there's a conflict and we must ask the user > =A0 =A0what to do (this gets complicated). Simple solution: the first file it comes across that already exists will fail the package install. Again, the user needs to get involved in whether or not the previous package needs to be fixed, whether or not they created a filename collision, etc. Prompts are bad and only block automated processes from completing their tasks properly. If someone wants to write another layer on top of pkg_install, that's fine though.. it really should be dealt with there as we're trying to be as functionally trimmed down as possible. > =A0* Extract all of the files, failing if there is a > =A0 =A0file in the tarball that wasn't listed in +CONTENTS > =A0 =A0or if there is a file in the tarball that already > =A0 =A0exists on disk (which must have been created in the > =A0 =A0intervening window). Ok. Thanks for a more concrete breakdown of what you had in mind. I'll implement it after some manual testing in a bit... Cheers, -Garrett