Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Mar 2014 23:42:12 +0100
From:      Jan Henrik Sylvester <me@janh.de>
To:        Matthew Seaman <matthew@FreeBSD.org>,  Andrea Venturoli <ml@netfence.it>
Cc:        questions-list freebsd <freebsd-questions@freebsd.org>
Subject:   Re: pkg equivalent of "pkg_info -R"
Message-ID:  <531B9CC4.9050205@janh.de>
In-Reply-To: <53196D17.8000300@FreeBSD.org>
References:  <53186ABC.5060601@netfence.it> <20140306184030.078a99cedac859b5c5b83e22@embarqmail.com> <53196D17.8000300@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/07/2014 07:54, Matthew Seaman wrote:
> Yes, being able to generate the entire dependency tree would be a
> desirable option.  It's not particularly difficult, but it does require
> implementing recursive behaviour for such lookups.  That just needs
> someone to step up and code it...
> 
> Until then, you'ld have to write a shell wrapper around pkg query to
> achieve the same effect.

For reverse dependencies, you can abuse pkg delete:

pkg delete -Rn gnutls | grep '^[[:blank:]]'

(From the manpage, I would have thought that the q option would suppress
the first and last line, but it does not.)

This has the same result as the shell script posted in this thread aside
from containing gnutls itself, but on the positive side, it is a factor
of 100 faster on my machine.

This seems to work under normal conditions. Unfortunately, a few days
ago I had a cyclic dependency (x264<->ffmpeg), in which case "pkg delete
-R" would error and not find all reverse dependencies. Anyhow, this
should never happen and you probably want the error message in that case.

If it was only as easy as this for dependencies (not reverse).

Cheers,
Jan Henrik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?531B9CC4.9050205>