Reputation: 25117
Is it possible to add a minimum version to a module listed in the depend
section of a META6.json
file?
Upvotes: 6
Views: 124
Reputation: 5726
To declare a dependency on Foo
of version 1 or higher one would do the same as if one was asking zef to install Foo:ver<1.0+>
:
zef install "Foo:ver<1.0+>"
"depends" : [
"Foo:ver<1.0+>"
]
Long form identities use version literals for api
and ver
attributes, and strings for any other (such as auth
, file
, name
, etc). So to describe such a dependency you should write it the same way you would if you were use
ing it using the literal form :foo<...>
ala use Test:ver<6.d+>
. This is opposed to :foo(...)
form which can run anything, e.g. use Test:ver(do { say 42; v6.d+ })
, which would allow arbitrary code execution by just searching for dependencies and thus is not a valid way to describe something in a META6.json
Upvotes: 5
Reputation: 23527
It uses the same syntax as the Version
class. You can use, for instance, v1.0+
, or, in META6.json, simply "1.0+"
Upvotes: 6