Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jun 2003 20:16:07 -0400
From:      parv <parv_fm@emailgroups.net>
To:        Adam <blueeskimo@gmx.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Listing installed ports without any ports dependent on it
Message-ID:  <20030603001607.GA3613@moo.holy.cow>
In-Reply-To: <1054590763.16970.5.camel@jake>
References:  <1054590763.16970.5.camel@jake>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <1054590763.16970.5.camel@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.

  #!/bin/sh
  pkgdb=/var/db/pkg

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


  - Parv

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

  http://www103.pair.com/parv/work/



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