Change multimethods to take first match instead of being rigid.
- Formerly required that one and only one spec match - Now allows first match in a list (more flexible and more intuitive) - introduces new bug that provides() doesn't do the correct thing when a version is not in a range that has been explicitly provided. - TODO: fix this.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
Developer Guide
|
||||
=====================
|
||||
|
||||
This guide is intended for people who want to work on Spack's inner
|
||||
workings. Right now it's pretty sparse.
|
||||
|
||||
Spec objects
|
||||
-------------------------
|
||||
|
@@ -1060,17 +1060,17 @@ for example:
|
||||
# the default, called when no @when specs match
|
||||
pass
|
||||
|
||||
@when('mpi@3:')
|
||||
@when('^mpi@3:')
|
||||
def setup_mpi(self):
|
||||
# this will be called when mpi is version 3 or higher
|
||||
pass
|
||||
|
||||
@when('mpi@2:')
|
||||
@when('^mpi@2:')
|
||||
def setup_mpi(self):
|
||||
# this will be called when mpi is version 2 or higher
|
||||
pass
|
||||
|
||||
@when('mpi@1:')
|
||||
@when('^mpi@1:')
|
||||
def setup_mpi(self):
|
||||
# this will be called when mpi is version 1 or higher
|
||||
pass
|
||||
|
Reference in New Issue
Block a user