pkg query hackaton

Grzegorz Junka list1 at gjunka.com
Wed May 22 13:07:18 UTC 2019


Hi,

I am interested in two pkg query solutions and I thought I will ask here 
first, maybe someone already spend time or knows a better approach.

1. List of packages sorted by the amount of packages that depend on them

2. List of all recursive dependencies of a particular package


Ad1. Basically, it would be a list of all packages installed in the 
system where for each package the query would retrieve the amount of 
dependent packages. Then sort that list.

Bonus. Can 1. be also recursively, e.g. sum amounts of all dependent 
packages, then for each dependent package add that package's dependent 
packages, etc. This will likely cause loops so probably a state with 
packages already added would need to be maintained.

Ad2. Given package A list all its direct dependencies, then for each 
dependency list its dependencies, and so on. Add them to a big list then 
sort and unique. Can that be done in pkg query alone?


Out of interest, is "pkg install -R" truly recursive, i.e. would it 
reinstall any packages that require the given package indirectly 
(through another package, not through a direct dependency)?

GrzegorzJ




More information about the freebsd-ports mailing list