Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Apr 2010 01:51:29 -0700
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        David Forsythe <dforsyth@freebsd.org>, Perforce Change Reviews <perforce@freebsd.org>, Florent Thoumie <flz@esat.net>
Subject:   Re: PERFORCE change 176831 for review
Message-ID:  <h2v364299f41004150151wf7254800x6006ceefbbb61152@mail.gmail.com>
In-Reply-To: <4BC5DCDD.2060902@freebsd.org>
References:  <201004121230.o3CCUsIX029146@repoman.freebsd.org> <4BC3EB5B.5070801@freebsd.org> <l2y364299f41004122249q2f5734a7j89be807581e42dac@mail.gmail.com> <4BC53714.80805@freebsd.org> <r2x364299f41004140053y7b43d454qb7804e111d1920a6@mail.gmail.com> <g2v364299f41004140056pee1cde28laee26c8d5d1c9d19@mail.gmail.com> <v2j364299f41004140100gdd528438j17ef6ae6d2962cae@mail.gmail.com> <4BC5DCDD.2060902@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 14, 2010 at 8:18 AM, Tim Kientzle <kientzle@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?h2v364299f41004150151wf7254800x6006ceefbbb61152>