Florian Weimer <f...@deneb.enyo.de> 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 <r...@debian.org> Seconded: Raphaƫl Hertzog <hert...@debian.org> Seconded: Manoj Srivastava <sriva...@debian.org> Seconded: Guillem Jover <guil...@debian.org> 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 (r...@debian.org) <http://www.eyrie.org/~eagle/> -- To UNSUBSCRIBE, email to debian-dpkg-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org