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

Wrong handling of empty strings in version numbers



Hi all,

I think the handling of empty strings in version numbers is wrong
(tested with dpkg 1.10.10).  I experienced with two packages
pkg_1.1beta3-1_i386.deb and pkg_1.1-1_i386.deb. It seems that 1.1beta3-1
is newer than version 1.1-1. Is this true?

OK, let's analyze Debian Policy 3.6.1.0, section 5.6.11:

 * first "1.1" is compared with "1.1", they are equal, so the test continues
 * now "" is compared with "beta3"
   (is this correct, or is "-" compared with "beta3-"?)
   "an empty string" ... "counts as zero", so "0" is compared with
   "beta3", because of "letters sort earlier than all the non-letters"
   we obtain 1.1beta3-1 < 1.1-1 !

   Even if "zero" is considered to be the first ascii character \0,
   "letters sort earlier" leads to 1.1beta3-1 < 1.1-1

Am I wrong?

Jens



Reply to: