From owner-p4-projects@FreeBSD.ORG Mon Jul 19 01:57:33 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B43ED1065678; Mon, 19 Jul 2010 01:57:33 +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 6008D106564A; Mon, 19 Jul 2010 01:57:33 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 17A1B8FC18; Mon, 19 Jul 2010 01:57:32 +0000 (UTC) Received: by iwn35 with SMTP id 35so5151061iwn.13 for ; Sun, 18 Jul 2010 18:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=GUPRTUvIKHlez0hYMXsVw16cchahln/++k6REoxNz1U=; b=WrFa7dzn3dFsMnJRh5FfX2DmfztOpgjY+qIeGHKR7Q96G7Kic1NBxaRMLu3RVrePPd gJm2i+F4J1ufKcTT1WWAqGgqzqH9Gkj4+QrQQKdmKM3q5Ztr0VZEkI3BvoWLcoDfatJt ZYjlSVQ7qRRn3wtWV7vBx4tDln+l4PF77f50Q= 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; b=v5IX6hpXnaYRsCOkYMg83NAO9fZ3K2l389dKA+Wb8Rf/udVgWwzSa/fJUzaQK8x1Dv MBq1ZpH9YH/DSyphSl2HcK5GZYHXwJ5C7XfFsYvNpZ6iZtSS8Do2pDo9+MBAsyCqEr/y InTaBcvu2HseGDnQntVejDDq7JALD44bC+/r0= MIME-Version: 1.0 Received: by 10.231.14.201 with SMTP id h9mr4354243iba.135.1279504652118; Sun, 18 Jul 2010 18:57:32 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.169.18 with HTTP; Sun, 18 Jul 2010 18:57:32 -0700 (PDT) In-Reply-To: References: <201007182159.o6ILxBSq023260@repoman.freebsd.org> Date: Sun, 18 Jul 2010 18:57:32 -0700 X-Google-Sender-Auth: tfjWeSLztrRb8-pPUupgyKTybvA Message-ID: From: Garrett Cooper To: Julien LAFFAYE Content-Type: text/plain; charset=ISO-8859-1 Cc: Perforce Change Reviews Subject: Re: PERFORCE change 181154 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: Mon, 19 Jul 2010 01:57:34 -0000 On Sun, Jul 18, 2010 at 4:40 PM, Julien LAFFAYE wrote: > On Mon, Jul 19, 2010 at 1:18 AM, Garrett Cooper 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