On Jul 19, 2004, at 10:52 AM, David Wheeler wrote:


On Jul 19, 2004, at 8:32 AM, Ken Williams wrote:

'dbi_support' => {
description => "Can read & write databases",
requires => q{
DBI >= 1.0 ,
(DBD::mysql >= 1.5 || DBD::Postgres)
},
},


In other words, when the value of "requires" or one of the other dependency items has a string value instead of a hash value, it means that we're using the mini-language to express those dependencies. It can also be used at the top level of the distribution, not associated with any sub-feature.

What if I need

  (   (DBD::mysql && DateTime::Format::mysql)
   || (DBD::Pg && DateTime::Format::Pg)
  )

? And how would I specify required version numbers for those modules?

You'd probably do it like this, which I think is pretty nice:


features =>
{
...
pg_support =>
{
description => "Interface with Postgres databases",
requires => q{ DBD::Pg >= 23.3 && DateTime::Format::Pg },
},
mysql_support =>
{
description => "Interface with MySQL databases",
requires => q{ DBD::mysql >= 17.9 && DateTime::Format::Pg },
},
...
}





Then, if we need macros (which is I think probably a better term than "virtual packages") we can add them in, but I think we can probably get by for a long time (perhaps eternally) without them.

Yes, but I do want the installer to report that one of the required sets of packages for a feature is not installed. That's do-able, yes?



Yup. It will parse the version specifiers and report whether they're satisfied.


 -Ken



Reply via email to