Version range in debian/control

When declaring dependencies in debian/control to create a package, I can specify a lower or upper bound on the version. For example, if I depend on libvtk6-dev being at least version 6.0.0 I can write in the Depends line:

 libvtk6-dev (>= 6.0.0)

But is it possible to specify a range? For example, if I depend on the version 6.0 or 6.1 of a package, but not 6.2 or 5.9, how would I specify that?

A more complex example would be if dependencies of a package changes depending on the version. For example, libvtk6-dev has missing dependencies, but this changes depending on the version of the package installed. How can I say something like: if libvtk6-dev is version 6.0 or 6.1 then also depends on libpython2.7-dev, and if the version is greater or equal to 6.2 then depend on libproj-dev?

2 Answers

You can do that with << example:

 libvtk6-dev (>= 6.0.0), libvtk6-dev (<< 6.2.0)

This way you have locked the range between 6.0.0 and 6.1.0. The same way you have to specify for each package individually, there is no if this dependency is this then ask for that.

1
  • So let's break it down:

    libvtk6-dev (>= 6.0.0), libvtk6-dev (<< 6.2.0), libpython2.7-dev

    OR (logic op)

    libvtk6-dev (>= 6.2.0), libproj-dev

    , in Depends: is like AND (logic op). | is OR (logic op) but they don't have same priority neither brackets to be combined directly in that order/form.

  • Here what I could come with:

    libvtk6-dev (>= 6.0.0), libvtk6-dev (>= 6.2.0) | libpython2.7-dev, libvtk6-dev (<< 6.2.0) | libproj-dev

    How to read it:

    1. Must libvtk6-dev (>= 6.0.0)
    2. If NOT libvtk6-dev (>= 6.2.0) then libpython2.7-dev
    3. If NOT libvtk6-dev (<< 6.2.0) then libproj-dev

Funny thing, this way is similar to NOR (or NAND) logic in electronics. If you have one of these then you can create all logic operations from it.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like