#1146868 dpkg --compare-versions result somehow unexpected

Package:
src:dpkg
Source:
src:dpkg
Submitter:
Matthias Klose
Date:
2026-09-06 15:55:04 UTC
Severity:
normal
Tags:
#1146868#5
Date:
2026-09-06 14:04:19 UTC
From:
To:
This is a version construction, where the prefix before the plus sign is
taken from the version of a binary package, and the suffix is derived
from another source package (i.e. a source package building using the
source packaged as a binary).

$ dpkg --compare-versions 2.47-2+1 lt 2.47-2ubuntu1+1; echo $?
1

Apparently, the -2 and -2ubuntu1 should be parsed as belonging to the
prefix.  Is this a known thing, and working as designed, or is this
something that should/could be fixed?

#1146868#12
Date:
2026-09-06 15:52:01 UTC
From:
To:
tag 1146868 wontfix
thanks

Hi!

This is how the algorithm has worked for a very very long time (as
documented in deb-version(7) and Debian Policy), I don't see anything
to fix here. Also even if we wanted, that would break so much stuff,
and would need coordination with so many implementations, that I don't
think it would be feasible anyway). Thus closing.

Thanks,
Guillem