[Exherbo-dev] Proposal for "option restrictions" syntax

Bernd Steinhauser exherbo at bernd-steinhauser.de
Sat Aug 9 01:57:17 BST 2008


First, what are "option restrictions"?
Option restrictions specify a set of restrictions for the state of 
option flags in an exheres.
For example, an exheres might have option foo1 and foo2.
If foo1 is enabled, it needs foo2 to be enabled, too.
The restrictions provide a way to do this.

The proposal is to define option restrictions under the label "options" 
in DEPENDENCIES and use them almost like normal dependency specifications.

MYOPTIONS="foo1 foo2 foo3 foo4 foo5 foo6 foo7 foo8 foo9:foo10 foo9:foo11"

DEPENDENCIES:
     build:
     ...
     build+run:
     ...
     options:
         foo1 ( foo2 )
         foo3 ( foo4= )
         foo5 ( foo6!= )
         foo7 ( foo8? )
         ...
         foo9:foo10 ( -foo9:foo11 )
     "

So they are basically the same as normal use dependencies, but without 
the cat/pkg[ ].
Removing the ? in foo? ( ) prevents the creation of stuff like
foo? ( )
!foo? ( )

So this example:
foo? ( foo2? )
!foo? ( foo3!? )

becomes

foo ( foo2? foo3!? )

It might also be a good idea to allow annotations:

MYOPTIONS="foo1 foo2 foo3 foo4"

DEPENDENCIES:
     build:
     ...
     build+run:
     ...
     options:
         foo1 ( foo2 )
         foo3 ( foo4! [[
                   description = [ foo3 and foo4 collide because of ... ]
                   resolution = disable
         ]]
     "

Here "disable" means, that the option flag (here foo4) is suggested to 
be disabled.

I think, that specifying the deps this way is very intuitive and I think 
it is easy to remember and use. :)

Discuss, please. :)

Regards, Bernd



More information about the Exherbo-dev mailing list