[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bug in dpkg --compare-versions



On Fri, Jan 29, 1999 at 09:32:40AM +0000, Edmund GRIMLEY EVANS wrote:
> dpkg --compare-versions does seem to give the right result if you
> remove the ".deb" suffix; maybe dpkg is intended to assume that the
> suffix isn't there. Anyway, there is a simple work-around: in
> /usr/src/boot-floppies/common.sh replace `basename $x` by
>  `basename $x | sed -e 's/\.deb$//'` (or a neater way of doing that).

Using that is wrong since dpkg --compare-versions requires version numbers
and not package names. Also you miss epochs (epochs are not visible
in file names, usually).
The correct fix is to use this:

dpkg --compare-versions `dpkg -f $a Version` gt `dpkg -f $b Version`

lupus

-- 
"The number of UNIX installations has grown to 10, with more expected."
    - _The UNIX Programmer's Manual_, Second Edition, June, 1972.


Reply to: