make pkg_install suite reusable, please

Alexander Churanov alexanderchuranov at gmail.com
Tue Apr 13 10:05:52 UTC 2010


2010/4/11 Robert Watson <rwatson at freebsd.org>

> So I have no particular opinion on this tool, but I will say that in
> general, it would be nice if programs were often thin wrappers around a
> library that could be reused, not just command line tools.
>
> Robert
>

Robert,

The reusable library is great. The question is how it works with the
underlying system. When dealing with a package database, one may provide a
library which directly reads and writes the database. On the other hand, the
library may re-use some command-line tools. In the latter case there are
chances for the package manipulating tool to stay consistent even if the
memory in the calling process (which uses the library) is damaged. The
database files are also less likely to became corrupted. Of course, run-time
performance should be sacrificed.

To summarize, there are two ways:

1) Provide the re-library and make command-line tools be just wrappers
around the library.
2) Provide command-line tools and make the library to be just a wrapper
around the tools.

Approaches provide different trade-offs between run-time performance and
isolation.

Alexander Churanov


More information about the freebsd-hackers mailing list