On Mon, 29 Nov 2021, The Wanderer wrote:

Is there a reason you're using '+' as your separator?

Yes - because, for example, squid I'm building with extra settings so I
want my version to be higher than the corresponding buster/bullseye
version. There is no backporting involved.

I think this looks like exactly the sort of scenario which '~' is
intended for.

But I didn't know ~ was different. Indeed, for packages I've backported
and want return to mainline eventually it sounds like what I should be
doing for backported packages.

$ dpkg --compare-versions 0.4b46-8+tjw10r1 lt 0.4b46-8 && echo "0.4b46-8
is newer" || echo "0.4b46-8 is not newer"
0.4b46-8 is not newer

$ dpkg --compare-versions 0.4b46-8~tjw10r1 lt 0.4b46-8 && echo "0.4b46-8
is newer" || echo "0.4b46-8 is not newer"
0.4b46-8 is newer

As I understand matters, a version "foo~" will always compare as lower
than a version "foo", and this is specifically to make it possible to do
fancy things like what you're apparently aiming for here.

That won't help you with your current set of local packages - but if you
switch to that for any ones you build in the future, it might give you a
path to the end state you're hoping for.


Indeed, sounds perfect. Thank you. I'll have to rework my scripts so I
can choose ~ or + depending on whether I'm backporting a higher version
from a future release or patching the current release.

I already have config for $source_distribution and $target_distribution
so I might be able to automate the patch version.

Thats the bit of magic I needed. Thanks!

Reply via email to