From owner-freebsd-ports@freebsd.org Fri Jan 12 15:38:35 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 8630EE6BBC9 for ; Fri, 12 Jan 2018 15:38:35 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [IPv6:2001:8b0:151:1:c4ea:bd49:619b:6cb3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A3037068D for ; Fri, 12 Jan 2018 15:38:35 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from leaf.local (unknown [88.202.132.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 90EEA10A8B for ; Fri, 12 Jan 2018 15:38:32 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/90EEA10A8B; dkim=none; dkim-atps=neutral Subject: Re: pkg search dependency tree To: freebsd-ports@freebsd.org References: <20180112120903.6cba8b16@efreet-freebsd.kappastar.com> From: matthew@FreeBSD.org Message-ID: <5252b45f-5ef1-64fa-02c3-dc954f8574d5@infracaninophile.co.uk> Date: Fri, 12 Jan 2018 15:38:20 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180112120903.6cba8b16@efreet-freebsd.kappastar.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit 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: Fri, 12 Jan 2018 15:38:35 -0000 On 12/01/2018 11:09, Marko Cupać wrote: > Hi, > > I have accidentally deleted my poudriere package lists. I still have > all packages in my repos. > > I know I can get list of all packages in my repo in appropriate > format with `pkg search -o -x . | awk -F ' ' '{ print $1 }' | sort', > but this way I'm listing also ports which are installed only as > dependencies, which I'd like to avoid - I'd like to list only "top > level" ports, so that I don't build a dependency if top port doesn't > need it. > > Is there a way to get dependency tree from pkg search? > > Thank you in advance, > This is usually done by: pkg query -e '%a == 0' %o which gives you the list of packages on your system, excluding those that were automatically installed to fulfil dependencies. ie. it's basically the collection of packages where you said 'pkg install foo' at some point. However, if you want to print out the dependency tree: https://github.com/freebsd/pkg/blob/master/scripts/pkg_tree.sh Cheers, Matthew