Manually registering dependencies for ports

Garrett Cooper yanefbsd at
Mon Jun 7 14:18:37 UTC 2010

On Sun, Jun 6, 2010 at 4:53 PM, Thomas Rasmussen <thomas at> wrote:
> Hello,
> I've been wondering about something: When I write a script or webapp that
> needs some port to run, like a perl module, I install the needed port and
> life is good (tm). A year later when I've completely forgotten about the
> script I go do some spring-cleaning of the ports on the server, and I see
> some perl module that doesn't have any dependencies, and delete it. Fast
> forward a few days when I discover the script doesn't work anymore, cue
> face-palm, remove bullet from foot, etc.
> Is there some way I can register a dependency to prevent this ? Like
> adding a flag to an installed port to say "something outside of the ports
> system depends on this" along with a user specified comment string. A
> system like that could result in something like this:
> pkg_delete -x p5-something
> pkg_delete: p5-something cant be uninstalled because: " uses
> this module, for the love of everything good do not delete it"
> Is something like this already implemented, or does anyone have suggestions
> to where I might begin if I want to make this ? Am I the only FreeBSD
> admin absent-minded enough to have this problem ? :)
> Best regards
> Thomas Steen Rasmussen
> PS: I know that this kind of hand-holding is uncommon in FreeBSD. We
> allow all kinds of foot-shooting, but a safeguard like this would be a nice
> improvement to an (IMO) already excellent ports system.

    It would probably just be better to create ports Makefiles for
this and then run a make install ; that way you have all of the
required metadata for the package you just created. If you go this
route you'll need several skeleton files to create a complete port.
You can look at any port, or here's another simple example port (
). Feel free to skip the pkg-deinstall script.

More information about the freebsd-ports mailing list