Florian Weimer <[email protected]> writes:
> $ python -c 'import apt_pkg; apt_pkg.init(); print
> apt_pkg.VersionCompare("1", "1-0")'
> -1
> $ dpkg --compare-versions '1' = '1-0'; echo $?
> 0
>
> 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 <[email protected]>
Seconded: Raphaƫl Hertzog <[email protected]>
Seconded: Manoj Srivastava <[email protected]>
Seconded: Guillem Jover <[email protected]>
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:
http://bugs.debian.org/458910
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 ([email protected]) <http://www.eyrie.org/~eagle/>
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]