PERFORCE change 176831 for review

Garrett Cooper gcooper at FreeBSD.org
Thu Apr 15 08:51:31 UTC 2010


On Wed, Apr 14, 2010 at 8:18 AM, Tim Kientzle <kientzle at freebsd.org> wrote:
>>>>> But I really do believe that single-pass direct
>>>>> install is feasible and is eventually where we want
>>>>> to be.  The 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:  delete 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:
>  * Read and parse +CONTENTS

Ok.

>  * Check the package database to verify that
>    dependent packages exist and that no conflicting
>    packages exist.  If there's a problem, ask the
>    user what to do.  (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.

>  * Check the disk to verify that none of the files
>    listed in +CONTENTS already exist on disk.  If so,
>    there's a conflict and we must ask the user
>    what 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.

>  * Extract all of the files, failing if there is a
>    file in the tarball that wasn't listed in +CONTENTS
>    or if there is a file in the tarball that already
>    exists on disk (which must have been created in the
>    intervening 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


More information about the p4-projects mailing list