Date: Sun, 18 Jul 2010 18:57:32 -0700 From: Garrett Cooper <gcooper@FreeBSD.org> To: Julien LAFFAYE <jlaffaye@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 181154 for review Message-ID: <AANLkTimIkYOkzuSJx2Vmb7zsLMANxusspgvAAANgFCtP@mail.gmail.com> In-Reply-To: <AANLkTilxPpto02RO4tkmuGA9TtaCte6Wc6-iOTW_Z_B7@mail.gmail.com> References: <201007182159.o6ILxBSq023260@repoman.freebsd.org> <AANLkTim43YyI5TgcmZUDu1g6MOj3nzqpZCiB7awj70gB@mail.gmail.com> <AANLkTilxPpto02RO4tkmuGA9TtaCte6Wc6-iOTW_Z_B7@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jul 18, 2010 at 4:40 PM, Julien LAFFAYE <jlaffaye@freebsd.org> wrote: > On Mon, Jul 19, 2010 at 1:18 AM, Garrett Cooper <gcooper@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimIkYOkzuSJx2Vmb7zsLMANxusspgvAAANgFCtP>