Tom Bartol <> wrote:
>ports/package database system but it occurred to me that perhaps the
>database is currently only storing which packages a given package depends
>upon and is NOT storing which packages depend upon a given

The port source tree stores a list of pre-requisite packages in each
Makefile.  The `required-by' list is not stored - it would be a
nightmare to maintain.

On installation, the packages database stores both dependency
directions.  /var/db/pkg/<PACKAGE>/+CONTENTS contains the list of
pre-requisite packages in `...@pkgdep' records.  The +CONTENTS file is
part of the package.  /var/db/pkg/<PACKAGE>/+REQUIRED_BY contains the
`required-by' list and is maintained automatically by the package
management tools (eg installing `foo' which depends on `bar' adds
a line `foo' to /var/db/pkg/bar/+REQUIRED_BY, which is removed if
the package in removed).

The problem is that the package management system provides `add' and
`delete' functions only, and the delete function (by default) requires
all dependent packages to be deleted first.  (You can force the delete
to ignore the dependent packages, but that loses the +REQUIRED_BY file

There's no mechanism for updating a package - and it's not clear (to
me anyway) how this can be done safely in a general way.  Where the
update is only minor (and won't affect the dependent packages), you
can use something like:

mv /var/db/pkg/bar-1.1/+REQUIRED_BY /var/db/pkg/save
pkg_delete bar-1.1
pkg_add bar-1.2
mv /var/db/pkg/save /var/db/pkg/bar-1.2/+REQUIRED_BY

This approach can't pick up the dependent packages that really do need
to be re-compiled against the newly installed package.


To Unsubscribe: send mail to
with "unsubscribe freebsd-current" in the body of the message

Reply via email to