Discussion:
Binary packages on NetBSD: Importing pkg(8) from FreeBSD?
Marc Balmer
2014-10-14 06:33:43 UTC
Permalink
[This has also been posted to pkgsrc-***@netbsd.org]

FreeBSD has now by default pkg(8) (formerly called pkgng) as the default manager for _binary_ packages. It replaces the old pkg_* tools. pkg(8) is a manager for binary packages _only_; to produce the binary packages the FreeBSD ports system is used almost unaltered. pkg(8) has been designed to be a modern binary package manager that can among other things properly deal with update situations, properly resolve dependencies and in general allows systems to be managed with binary packages easily.

pkg(8) is not part of the base system, the base system only contains a way to bootstrap pkg(8). pkg(8) itself resides in the FreeBSD ports tree.

I think pkg(8) would be a good thing for NetBSD to have, too. pkg(8) is properly designed and allows for different binary package formats (at least in theory), so it could probably be feasible to add a pkg(8) backend that handles binary packages produced using pkgsrc.

afaict, the following steps would be needed:

- Tell the upstream developers about our plans (the pkgsrc backend should become part of the upstream code, if possible)
- Import the pkg(8) bootstrap mechanism into NetBSD base (src/external).
- Extend pkg(8) to deal with pkgsrc-produced binary packages.
- Import pkg(8) into pkgsrc.
- Coordinate local changes with the upstream developers.

As pkg(8) "only" deals with binary packages, this would be complimentary to the existing pkg_* tools that come with pkgsrc, i.e. it's use would be optional.

Is anyone besides me interested in such work and would be able/willing to spend some amount of time on this?

- mbalmer
Greg Troxel
2014-10-14 11:32:21 UTC
Permalink
I feel like I'm missing something, because it seems like you are saying
all of the following, some of which are contradictory.

pkg(8) is like pkgin/nih
pkg(8) replaces pkg_*
pkg(8) is complementary to pkg_* and is optional
pkg(8) needs some bootstrap mechanism (which pkgin doesn't really)

In pkgsrc we seem to have evolved a situation where the basic package
tools enable creating packages from source and adding and remove single
packages (with simple fetch-and-install dependency management), and then
there are two package managers that can be used on top of the basic
tools.

So certainly pkg(8) could be added as a third binary package manager, as
a package in pkgsrc. But if the existing tools are going to stay
(which seems clear, at least in the near term), then I don't understand
why pkg(8) needs a bootstrap mechanism.


There's a perhaps larger question, which is if there's a specification
for both the package format itself and the control files stored in
/var/db/pkg; I get the impression pkg(8) manipulates those directly and
is thus a replacement for the union of pkg_* and pkgin/nih.

Loading...