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

Bug#664209: apt_preferences: package of higher prio not choosen?!



On 17 March 2012 05:54, Christoph Anton Mitterer <calestyo@scientia.net> wrote:
> Hi David.
>
> On Fri, 2012-03-16 at 18:54 +0100, David Kalnischkies wrote:
>
>> I would recommend to avoid the practice of rebuilding with the same version-
>> number through. It's harder to find out if its an official or a self-build
>> package in case of a bug and you have problems like this one.
> Well it has it's problems,.. but if I change the version number, how can
> I guarantee, that the maintainer/security team chooses one that is
> considered as higher, than mine...
>

Like David says, please always modify the version number.

Just consider the smallest possible increments that the Debian package
would get and pick a version below those:

Current Debian: 2.3-1
Maintainer update: 2.3-2
NMU update: 2.3-1.1
Security update: 2.3-1+anupdate1
New upstream: 2.4-1

Your modified version: 2.3-1+calestyo1

Check the results with dpkg (0 means ok; 1 means not ok):

$ set 2.3-1+calestyo1
$ dpkg --compare-versions 2.3-1 lt $@; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-2; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-1.1; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-1+anupdate1; echo $?
1

This is not ok because +calestyo1 is considered higher than
+anupdate1.  Try adding '~' (which is lower than everything else;
still need '+' however):

$ set 2.3-1+~calestyo1
$ dpkg --compare-versions 2.3-1 lt $@; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-2; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-1.1; echo $?
0
$ dpkg --compare-versions $@ lt 2.3-1+anupdate1; echo $?
0
$ dpkg --compare-versions $@ lt 2.4-1; echo $?
0

Ok!

Using that version you are considered more recent than 2.3-1, but will
be updated if the Debian version increases at all.

As a final note, if the current Debian version is something like
2.3-1+anupdate1 then you should still add to that:
2.3-1+anupdate1+~calestyo1



Reply to: