Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jan 2018 15:38:20 +0000
From:      matthew@FreeBSD.org
To:        freebsd-ports@freebsd.org
Subject:   Re: pkg search dependency tree
Message-ID:  <5252b45f-5ef1-64fa-02c3-dc954f8574d5@infracaninophile.co.uk>
In-Reply-To: <20180112120903.6cba8b16@efreet-freebsd.kappastar.com>
References:  <20180112120903.6cba8b16@efreet-freebsd.kappastar.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5252b45f-5ef1-64fa-02c3-dc954f8574d5>