PERFORCE change 181154 for review

Garrett Cooper gcooper at FreeBSD.org
Mon Jul 19 01:57:34 UTC 2010


On Sun, Jul 18, 2010 at 4:40 PM, Julien LAFFAYE <jlaffaye at freebsd.org> wrote:
> On Mon, Jul 19, 2010 at 1:18 AM, Garrett Cooper <gcooper at freebsd.org> wrote:
>> Wouldn't it make more sense for extract_package to be in libpkg,
>> because it's basically a utility function that would be used by
>> pkg_add and pkg_complete?
> pkg_add will deal with both regular and complete packages.
> pkg_complete is only for the creation of complete packages.
> But it wont hurt to move this function into libpkg I suppose.

Ok, now it makes sense. I would still move it out into a separate
function though, because I would think that the operations being
performed in pkg_add with pkg_complete and pkg_create created packages
would grossly differ. We need to break up functionality in pkg_add,
not make it more hideous to deal with :(...

>> Also, Tim and I discussed initializing the decompressor only once
>> because it would greatly simplify the code in libpkg today, and would
>> eliminate wasted CPU cycles used when initializing the decompressor
>> each time a metadata file is extracted from the archive object.
>
> Totally agree. Which line(s) of code are you referring to?

All of the unpack functions in libpkg/file.c .

> Because I'm not aware of re-initializing it every time (maybe a high
> level libarchive function?)

Every time you call archive_read_new and
archive_read_support_compression_all, it wastes time (unfortunately)
archive_read_new is just CPU time on initializing data structures,
where archive_read_support_compression_all has to initialize the
bzip2, gzip, (and now lzma on more recent copies of CURRENT)
decompressors.

>> Sorry to be a wanker on this too, but considering that all of the code
>> moved over from extract.c is basically `new code', could it be cleaned
>> up for style(9)?
> Yeah, I tried to fix the code while moving it but I must admit that it
> wasn't the first goal.
> Wanted to check if the whole function worked, eww :p
> Again, any particular rules of style(9) in mind ?

:D... I actually wouldn't worry about this too much right now I
suppose *sigh*. Just keep up the good work, and I guess once
everything has reached steady state I'll need to go and clean stuff up
with flz's help.

Thanks!
-Garrett


More information about the p4-projects mailing list