Re: Is 1-0 equal to 1 as a version?
Florian Weimer <email@example.com> writes:
> $ python -c 'import apt_pkg; apt_pkg.init(); print apt_pkg.VersionCompare("1", "1-0")'
> $ dpkg --compare-versions '1' = '1-0'; echo $?
> I think dpkg is right because policy says:
> | The absence of a <debian_revision> is equivalent to a
> | <debian_revision> of `0'.
Policy was changed to match dpkg in April of 2007:
* Policy: better document version ranking and empty Debian revisions
Wording: Russ Allbery <firstname.lastname@example.org>
Seconded: Raphaël Hertzog <email@example.com>
Seconded: Manoj Srivastava <firstname.lastname@example.org>
Seconded: Guillem Jover <email@example.com>
Closes: #186700, #458910
> So this looks like a bug in APT. But I think that in practice, the
> APT algorithm is the dominant one, so it might make sense to update
> policy and dpkg instead.
Debian revisions of -0 are quite rare in practice, which is probably why
no one has noticed the discrepancy. We had a discussion of this in:
although I don't think anyone realized at the time that apt didn't do the
same thing as dpkg. My feeling is that dpkg should probably win here, but
I guess I don't feel strongly about it.
Russ Allbery (firstname.lastname@example.org) <http://www.eyrie.org/~eagle/>