Backported dependency gets lower version number than the required one

Asked by Alexander Solovets

Originally posted at http://askubuntu.com/questions/895965/how-to-properly-backport-dependencies-when-backporting-a-package-to-ppa

I want to backport package X that depends on Y, so both packages need backporting. First, I backport Y, so it becomes something like Y-a.b~ubuntu123. When I now try to backport X it complains about missing dependency Y-a.b due to weird version comparison algorithm, which makes effectively Y-a.b~ubuntu123 < Y-a.b :

(From debian.org):
First the initial part of each string consisting entirely of non-digit characters is determined. These two parts (one of which may be empty) are compared lexically. If a difference is found it is returned. The lexical comparison is a comparison of ASCII values modified so that all the letters sort earlier than all the non-letters and so that a tilde sorts before anything, even the end of a part. For example, the following parts are in sorted order from earliest to latest: ~~, ~~a, ~, the empty part, a.

Question information

Language:
English Edit question
Status:
Answered
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Colin Watson (cjwatson) said :
#2

Yes; the backported-to version has to be lower than the backported-from version in order for upgrades to work properly. The standard solution is to add a trailing "~" to the dependency, so that it's something like "Y (>= a.b~)" rather than "Y (>= a.b)". You'll find that in quite a few packages in Debian and Ubuntu that have found that they care about supporting backports.

Can you help with this problem?

Provide an answer of your own, or ask Alexander Solovets for more information if necessary.

To post a message you must log in.