From owner-freebsd-ports@freebsd.org Sun Jan 14 20:00:09 2018 Return-Path: Delivered-To: freebsd-ports@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 23757EB3E24 for ; Sun, 14 Jan 2018 20:00:09 +0000 (UTC) (envelope-from sergey@akhmatov.ru) Received: from dutch.chaklun.ru (dutch.chaklun.ru [IPv6:2a01:7c8:aab0:135::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E48C26A44A for ; Sun, 14 Jan 2018 20:00:08 +0000 (UTC) (envelope-from sergey@akhmatov.ru) Received: from [213.141.144.221] (helo=[192.168.1.7]) by dutch.chaklun.ru with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90 (FreeBSD)) (envelope-from ) id 1eaoRp-0005O2-QZ; Sun, 14 Jan 2018 23:00:05 +0300 Subject: Re: pkg search dependency tree To: =?UTF-8?Q?Marko_Cupa=c4=87?= , freebsd-ports@freebsd.org References: <20180112120903.6cba8b16@efreet-freebsd.kappastar.com> <5252b45f-5ef1-64fa-02c3-dc954f8574d5@infracaninophile.co.uk> <20180114111522.6793c082@efreet-freebsd.kappastar.com> From: Sergey Akhmatov Message-ID: <5aae2938-5d64-e98c-3ea4-279203352d05@akhmatov.ru> Date: Sun, 14 Jan 2018 23:00:03 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180114111522.6793c082@efreet-freebsd.kappastar.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jan 2018 20:00:09 -0000 > I got off-list reply on how to achieve this with locally installed > packages, by using `pkg prime-origins', which is apparently an alias to > the command you suggested. > > It will solve my problem, as I have no more than 20 servers using this > repo, I just need to run the command on all of them and uniq the output. > > But it would be nice if I could do this for all the packages in repo, > and not just for packages installed locally on each server. You could useĀ  "pkg rquery", which handles requests agains remote repo database. It features less request types than "pkg query" against local packages database, but I hope it could give some help for you problem. E.g. you could use: % pkg rquery '%o - %?r' to get list of packages with a number of reverse dependencies and consider the ones with zero reverse dependencies as 'top level'. 'man pkg-rquery' may give some other hints.