2008/11/4 Raphael Hertzog <[EMAIL PROTECTED]>: > On Fri, 31 Oct 2008, Raphael Geissert wrote: >> Package: dpkg-dev >> Version: 1.14.22 >> >> Attached are the results of running a test suite on Dpkg::Version. The test >> suite was written to help make sure "equivalents" of dpkg's vercmp do conform >> with policy and dpkg's own implementation. > > What about attaching the code of your test suite?
Seems like I forgot to add a reference to it, sorry. It is under dvs/ at: git://git.debian.org/git/users/atomo64-guest/misc-devscripts.git Just cd to dvs and type ./test --help. > > I would have also expected some more analysis of failures because at first > look I think you reported many non-problems and would rather concentrate > on real problems. They are all real problems, keep on reading. > > Do you really believe that the code that we're using daily everywhere can > fail 141 times out of 731? dpkg's doesn't, Dpkg::Version doesn't do what it says it does. > >> dpkg-dev.pl failed test 'foo- foo 0'/tests/foo with '1' >> dpkg-dev.pl failed test 'foo- foo+ -1'/tests/foo with '1' > > We don't have "foo" packages do we ? However this looks like a real > difference between dpkg --compare-versions and Dpkg::Version::vercmp(). No, it doesn't, but it is a test of two versions which should be supported because a) dpkg does support them b) it is policy-compliant. > >> dpkg-dev.pl failed test '3.3-1.1 3.1-1 1 acl2'/tests/versions.lenny-sid with >> '2' > > Both 1 and 2 are greater than 0 and that's the only thing that matters in > version comparison. Please adjust your test suite accordingly (of course > same goes for negative numbers) and post the updated results. No it is not the only thing that matters. If I store the result in $res and then do something like the following it won't do the right thing because of the bug in Dpkg::Version: if ($res eq 1) { do stuff } elsif ($res eq 0) { do some other stuff } else { bah, do yet some other stuff } The example code is correct, because it expects what the documentation of Dpkg::Version says it does: 8<----------------------->8 Compare the two arguments as dpkg-style version numbers. Returns -1 if the first argument represents a lower version number than the second, 1 if the first argument represents a higher version number than the second, and 0 if the two arguments represent equal version numbers. 8<----------------------->8 Can you tell me where in the above quoted lines it says that it may return a number higher than 1? > > Cheers, > -- > Raphaël Hertzog > > Le best-seller français mis à jour pour Debian Etch : > http://www.ouaza.com/livre/admin-debian/ > Cheers, -- Raphael Geissert - Debian Maintainer www.debian.org - get.debian.net Jack Benny - "Give me golf clubs, fresh air and a beautiful partner, and you can keep the clubs and the fr...