From owner-freebsd-questions@freebsd.org Fri Nov 10 17:20:14 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93977E7265E for ; Fri, 10 Nov 2017 17:20:14 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3167B4F6 for ; Fri, 10 Nov 2017 17:20:14 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: by mailman.ysv.freebsd.org (Postfix) id 7C728E7265D; Fri, 10 Nov 2017 17:20:14 +0000 (UTC) Delivered-To: questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C1C2E7265C for ; Fri, 10 Nov 2017 17:20:14 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.home.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "fileserver.home.qeng-ho.org", Issuer "fileserver.home.qeng-ho.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F70A7B4F4 for ; Fri, 10 Nov 2017 17:20:13 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.home.qeng-ho.org (8.15.2/8.15.2) with ESMTP id vAAHK2tj032866; Fri, 10 Nov 2017 17:20:02 GMT (envelope-from freebsd@qeng-ho.org) Subject: Re: Find ports that are not in the requeirement of others To: roberthuff@rcn.com Cc: Roland Smith , Olivier , questions@freebsd.org References: <20171110055737.GA30695@slackbox.erewhon.home> <898813fa-5bc5-dae2-5d40-618e07761b9c@qeng-ho.org> <23045.56768.939054.823818@jerusalem.litteratus.org> From: Arthur Chance Message-ID: <3bed762f-81a1-6bff-6cc3-264236d1cb57@qeng-ho.org> Date: Fri, 10 Nov 2017 17:20:02 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <23045.56768.939054.823818@jerusalem.litteratus.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Nov 2017 17:20:14 -0000 On 10/11/2017 17:11, roberthuff@rcn.com wrote: > > Arthur Chance writes: > >> >> Is there an incantation of pkg(8) that can list all the ports that are a >> >> leaf in the tree of the installed ports. >> > >> > From pkg-query(8): >> > >> > pkg query -e '%#r = 0' %o >> > >> > Roland >> > >> >> Or if you have the default config file installed, simply >> >> pkg leaf > > On my system, "pkg query" returns 140 items, while "pkg leaf" > returns 217. > That is not round-off error. > Anybody know why? Distinctly odd. On my system root@arthur:3# pkg query -e '%#r = 0' %o | wc -l 62 root@arthur:3# pkg leaf | wc -l 62 No idea why you're not getting the same number but maybe you could try (pkg leaf; pkg query -e '%#r == 0' '%n-%v') | sort -u to see what the difference is. (Presuming your pkg leaf alias is the same as the query. "grep leaf /usr/local/etc/pkg.conf" to make sure.) -- An amusing coincidence: log2(58) = 5.858 (to 0.0003% accuracy).