On Apr 18, Tom Lees wrote > On Wed, 16 Apr 1997, [iso-8859-1] "Ole[iso-8859-1] Jrgen[iso-8859-1] Tetlie" wrote: > > > Hello, > > > > SmallEiffel (which I am packaging) uses negative version numbering. > > I assume dpkg can't handle that (it thinks -0.86 is later than -0.85, > > which it obviously isn't). The numbering is in the interval > > between -1 and 0. How should I map the version numbers to package > > numbers. My proposal is: n |-> n+1 , that is add one to the number. > > This maps version -1 (not released) to 0, and version -0 (the final) > > to 1, and preserving order inbetween. Is that OK? > > dpkg will handle this correctly. (It compares the "-" as a string, not > part of a number). Errm... No it won't. Unless dpkg suddenly believes that 0.86 < 0.85. Yes, you will indeed need to map the version numbers to something more sensible. And n |-> n+1 seems like a good choice. Btw, you don't need to 'assume' when it comes to the way dpkg orders version numbers. Just ask dpkg itself: chrish@pianocktail:[~] >dpkg --compare-versions -- -0.86 gt -0.85 chrish@pianocktail:[~] >dpkg --compare-versions -- -0.86 lt -0.85 Exit 1 (Remember that in shell programming, an exit code of 0 means true. The "--" is needed to turn off command-line switches processing. And "echo $?" will print out the exit code of the preceding command... I didn't need an echo $? because I've configured my shell to automatically print out the exit code when it's non-zero.) So here dpkg believes that -0.86 is greater than -0.85. Look at the last few lines of "dpkg --help" if you want to know all the possible relation operators. And if you really want to know the details of how dpkg compares version numbers, it's described in the... programmer's manual, if memory serves. Christian
Attachment:
pgpT8LUUgY70H.pgp
Description: PGP signature