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

bug in dpkg --compare-versions



I'm not sure whether this is a bug in dpkg or boot-floppies ...

The dpkg invocations that caused me problems were:

if dpkg --compare-versions util-linux_2.7.1-3.deb gt util-linux_2.7.1-3.4.deb; then echo yes; fi

if dpkg --compare-versions ae_962-21.deb gt ae_962-21.1.deb; then echo yes; fi

Both say "yes". This was with version 1.4.0.23.2 and version 1.4.0.33
of dpkg.

These cause boot-floppies to fail because it chose the older rather
than the newer versions of those packages. The older versions then
required older versions of slang and newt. It then ran out of space in
the floppy image because there isn't space for two versions of slang
and newt.

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).

Enrique, I suggest you make that change in common.sh even if the
behaviour of dpkg is going to be changed in the future as this problem
of picking up the wrong package may cause subtle problems otherwise.

Edmund


Reply to: