Listing installed ports without any ports dependent on it

parv parv_fm at
Mon Jun 2 17:21:18 PDT 2003

in message <1054590763.16970.5.camel at jake>, wrote Adam thusly...
> For each installed port that has NO other installed ports
> dependent on it, output the full name of the port
> In other words, I want a script to generate the list of ports that
> can be deinstalled without forcing (-f).

What you need is to check if '+REQUIRED_BY' file exists.  (For finer
control, also check if it is empty or not.)  If file does not exist
(or is empty), then there is no registered dependency.


  for p in $pkgdb/*
    [ -f "$p/+REQUIRED_BY" ] || { echo "$p" | sed -e "s!^$pkgdb/!!" ; }

  - Parv

A programmer, budding Unix system administrator, and amateur photographer
ISO employment.  Details...

More information about the freebsd-questions mailing list