Coming soon: pkg_add using full version comparisons to avoid spurious downgrades

From a post by Marc Espie on the OpenBSD ports mailing list:

Quote:

Running some final tests, but pretty soon, pkg_add will use full version comparisons to avoid spurious downgrades.

How this works:
a package has got a version number, such as zip-3.0, but that's not the full
story, it has a more complete signature, based on the depends it needs to run:
@depend and @wantlib lines.
So, for instance, zip-3.0 actually is zip-3.0,c.53.0 because it's built
against libc 53.0.

This is just a string representation of the actual signature object, which has
a complete structure that allows for comparisons.

Signature comparisons work as follows:
- compare the package name proper. If it's different, there's no need to look
further.
- if it's identical, look at the dependencies for both packages. Compare
each matching element. If one package consistently has bigger versions, then
it's more recent than the other. If there are mixed results, then we don't
know, and we will allow the update (but reluctantly).

It means precisely that. We have insisted on people bumping pkgnames when
things change INSIDE the package proper. That's particularly true when the
set of dependencies changes, since otherwise pkg_add won't be able to figure out which of two packages is the newest.