On Sunday, February 24, 2013 12:27:42 PM Julien Cristau wrote:
> On Thu, Feb 21, 2013 at 15:09:10 +0100, Piotr Ozarowski wrote:
> > [Julien Cristau, 2013-02-21]
> > 
> > > So there's bits in debpython/depends.py I don't understand.
> > > Why is maxv sometimes inclusive and sometimes exclusive?
> > 
> > I assume you're talking about minv==maxv case, that's a special case
> > and I admit it's confusing - that's why in experimental there's new
> > Version class (and VersionRange) which should fix the confusion
> > (when the refactoring is done)
> 
> Nope, I'm talking about
> 
> +            maxv = vrange[1]  # note it's an open interval (i.e. do not add
> 1 here!) [...]
> +                self.depend("%s (<< %d.%d)" %
>                              (tpl, maxv[0], maxv[1]))
> 
> vs
> 
> +                self.depend("%s (<< %d.%d)" %
>                              (tpl, maxv[0], maxv[1] + 1))
> 
> a few lines later.

Sorry for the long delay in replying.

The difference is that in the first case, where the maximum version has been 
specified, we can use that version directly.  Here's an example from Python 
policy:

          XS-Python-Version: >= A.B, << X.Y

(for python3, it's X-Python3-Version - but the syntax is the same)

In the second case, where it's for a compiled extension, the maxv refers to 
the maximum version the extension was built for, so the << %d.%d limit is 
correctly one more than this.

It probably would have been better to use different variable names here, but 
I'm confident the code is correct.  I did just now test, just to be sure, that 
X-Python3-Version: >= 3.2, << 3.3 will result in correct depends with the 
version in Sid.

Scott K

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to