Changes

Jump to navigation Jump to search
Line 285: Line 285:  
Assume that service requires cairo and source code uses cairo feature that appeared only in v1.8 but source code can fallback to previous cairo verisons too. If cairo can be installed from 0install feeds, there is no need in slots since service can declare "cairo >= 1.8" dependency and such cairo will be installed from 0install feeds. But if cairo could be installed from native packages there are no chances to know in advance what cairo version will present and service should have two implementations, one for cairo < 1.8 and one for cairo >= 1.8. In this case, slots will be useful.
 
Assume that service requires cairo and source code uses cairo feature that appeared only in v1.8 but source code can fallback to previous cairo verisons too. If cairo can be installed from 0install feeds, there is no need in slots since service can declare "cairo >= 1.8" dependency and such cairo will be installed from 0install feeds. But if cairo could be installed from native packages there are no chances to know in advance what cairo version will present and service should have two implementations, one for cairo < 1.8 and one for cairo >= 1.8. In this case, slots will be useful.
   −
There are two methods to define slots:
+
To declare slots for used dependency, ''slots'' and appropriate ''requires'' options should be placed to ''[Service]'' section that uses dependency:
* in service that uses dependency with slots
  −
* in dependency itself
  −
 
  −
In first case, ''slots'' and appropriate ''requires'' options should be placed to ''[Service]'' section that uses dependency:
      
   requires = <dependency>
 
   requires = <dependency>
 
   slots[<dependency>] = <versions-range>
 
   slots[<dependency>] = <versions-range>
   −
In second case, ''slots'' option should be placed to ''[Service]'' section that is used:
+
Option ''slots'' will declare compatibility ranges for particular dependency. Only one, closed from both sides, range could be used. For example in cairo case, it could be:
 
  −
  slots = <versions-range>
  −
 
  −
In both cases, ''slots'' option will declare compatibility ranges for particular dependency. Only one, closed from both sides, range could be used. For example in cairo case, it could be:
      
   1.0, 1.8, 2.0
 
   1.0, 1.8, 2.0

Navigation menu