From owner-freebsd-ports@FreeBSD.ORG Fri Jan 16 07:30:53 2009 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E23AB106564A; Fri, 16 Jan 2009 07:30:53 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by mx1.freebsd.org (Postfix) with ESMTP id D79FD8FC08; Fri, 16 Jan 2009 07:30:52 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz13 with SMTP id 13so5083723bwz.19 for ; Thu, 15 Jan 2009 23:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=plyIZzWfuQy1cN8IAJc88tLSqOVG+KPcS51qDfMSLfQ=; b=aS6uvCHI6ZzflZGWN+U/YAGEZeJdu63I5oxCDSndZv7o3U4ouDnpdI60XD0umeKMyi tvM3yISehdL06h6SCp/Mv575uJ0mqMJq3w1L/b9KuTFTYLDa9wymlwD463daO3UKTbSr /3XKELnFT82gT7fMU2LgJV5COKYuYIAtFmyJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=N2BRZBDpC7UyYc5rHlU3zWiKC7xP2EBpdokqs030N4vVUQSznudjtiTjtORuQTVrFu Np71/pkseAJnKBE7wVNwPo1hS1muwfHn3A5nWdgzbfKmogUA/iBefx2yiD9U0ygSTsxz 8JNNTWPHcTHHM3JEop68KU34buM7rhXVzJ0NQ= MIME-Version: 1.0 Received: by 10.181.193.15 with SMTP id v15mr737879bkp.168.1232091048871; Thu, 15 Jan 2009 23:30:48 -0800 (PST) In-Reply-To: <496F5151.7040703@icyb.net.ua> References: <496F360E.1000508@icyb.net.ua> <28283d910901150529xfac5a13k6f81d199ee2f48d@mail.gmail.com> <496F3AB4.20202@icyb.net.ua> <20090115150602.GF50694@atarininja.org> <496F5151.7040703@icyb.net.ua> Date: Thu, 15 Jan 2009 23:30:48 -0800 Message-ID: <7d6fde3d0901152330p32c51b64i212c660c0aaeb04c@mail.gmail.com> From: Garrett Cooper To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: matt donovan , Wesley Shields , kde@freebsd.org, FreeBSD Ports Subject: Re: pkg_info confusion (and configure.kde3) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2009 07:30:54 -0000 On Thu, Jan 15, 2009 at 7:08 AM, Andriy Gapon wrote: > on 15/01/2009 17:06 Wesley Shields said the following: >> On Thu, Jan 15, 2009 at 03:31:32PM +0200, Andriy Gapon wrote: >>> on 15/01/2009 15:29 matt donovan said the following: >>>> >>>> On Thu, Jan 15, 2009 at 8:11 AM, Andriy Gapon >>> > wrote: >>>> >>>> >>>> I am reading pkg_info(1), I see that pkg_info can be executed without >>>> any options/arguments, but the man page doesn't tell what happens in >>>> this case. >>>> >>>> In practice I see that configure.kde3 executes pkg_info in the above >>>> fashion (after printing "Looking for installed modules.") and what I >>>> observe is that pkg_info is examining all package files found in >>>> /var/packages. This takes quite long, obviously: >>>> >>>> >>>> 0 61827 28318 0 8 0 5992 2892 wait S+J p5 0:00.12 >>>> /usr/sbin/pkg_info >>>> 0 62162 61827 0 8 0 3492 1108 wait S+J p5 0:00.00 sh >>>> -c /usr/bin/tar -xp -j -f '/var/packages/All/curl-7.18.0.tbz' '+*' >>>> >>>> I am not sure if this is default behavior of pkg_info or it is somehow >>>> affected by environment. I run portupgrade -p and also have PACKAGES set >>>> to /var/packages. >>>> >>>> -- >>>> Andriy Gapon >>>> _______________________________________________ >>>> freebsd-ports@freebsd.org mailing >>>> list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports >>>> To unsubscribe, send any mail to >>>> "freebsd-ports-unsubscribe@freebsd.org >>>> " >>>> >>>> >>>> pkg_info run without args is the default way to run pkg_info it just >>>> prints out all packages/ports installed >>> Ok, but what did make it peek into the package files (as shown in ps axl >>> output above)? >> >> The output looks like this: >> >> zsh-4.3.9_4 The Z shell >> >> The second field comes from the +COMMENT file that lives in >> /var/db/pkg/foo. > > Thanks, but my question was: >> sh -c /usr/bin/tar -xp -j -f '/var/packages/All/curl-7.18.0.tbz' '+*' > why this command (and such for every package in /var/packages/All) was > spawned by pkg_info? > I.e. why pkg_info looks into package .tbz files instead of examining > /var/db/pkg? Looks like bad logic to me. Here's where the call is coming from (mind you I'm referencing pkg_install from CURRENT's sources): .../usr.sbin/pkg_install/info/perform.c:142 if (unpack(fname, "'+*'")) { .../usr.sbin/pkg_install/lib/file.c:354 if (vsystem("/usr/bin/tar -xp %s -f '%s' %s", comp, pkg, flist ? flist : "")) { Looking at the if-statement, it appears that the logic for the package finding is in fact sort of convoluted -- we should first check and see whether or not the package is installed, THEN if it's not installed we find the tarball (either from a local filesystem or a remote host), extract it, and grab the appropriate info. Does that sound like what should happen? Thanks, -Garrett