$OpenBSD: OpenBSD::RequiredBy.pod,v 1.3 2007/06/01 22:35:47 espie Exp $ =head1 NAME OpenBSD::RequiredBy - manage installed package dependencies =head1 SYNOPSIS use OpenBSD::RequiredBy; # let's do things for real our $not = 0; my $o = OpenBSD::RequiredBy->new($pkgname); my $o2 = OpenBSD::Requiring->new($pkgname); print "Requirements for $pkgname are ", join(' ',$o2->list), "\n"; # add some reverse dependencies $o->add($reverse_dep1, $reverse_dep2); # remove some dependency $o2->delete($dep); # forget some cache entry OpenBSD::RequiredBy->forget(installed_info($pkgname)); # compute the transitive closure of some dependencies my @fulldeps = OpenBSD::Requiring->compute_closure($pkg1, $pkg2); =head1 DESCRIPTION =for comment should add a reference to L when it's documented. C handles lists of forward and reverse dependencies for installed packages. If C<$main::not> is true, all change operations are done internally and never written to disk. C<$o = OpenBSD::RequiredBy-Enew($pkgname)> gives access to the reverse dependencies, C<$o =OpenBSD::Requiring-Enew($pkgname)> gives access to the forward dependencies. Such an object can be used to list the dependencies C<$o-Elist>, add names to them C<$o-Eadd(name1, name2, ...)> or remove name from them C<$o-Edelete(name1, name2, ...)>. The full list of forward dependencies (transitive closure) from a set of packages is given by Ccompute_closure($name1, name2, ...)>. Likewise, Ccompute_closure($name1, name2, ...)> yields the list of reverse dependencies. Those lists of dependencies trim duplicates and, unless C<$main::not> is true, disk files are automatically synchronized whenever the lists change. C maintains a cache for efficiency. When an installed package is deleted completely, Cforget($dir)> and Cforget($dir)> will remove the cache entries.