I would like a way to express in an info file that a module depends on a particular version of another module OR that module's dev branch. For example:
dependencies[] = somemodule(>7.x-1.0-alpha2, 7.x.-1.x)
That would mean that the dependency is satisfied by any version greater than alpha2 or by the dev version. Granted, there would be no way to know if the dev version someone has installed is actually more current than the alpha version, but the burden would fall on the site admin to make sure that a more current dev version is in use.
Without the ability to express "or the dev version", the site admin has no option to pull code from drupal's repo, since such code will not include a version number. (Current workaround is to manually add the version info.) Another possible way to express this...
dependencies[] = somemodule(>7.x-1.0-alpha2, NULL)
In other words, the dependency is satisfied by somemodule greater than alpha2, or by a copy of somemodule where the version info is not included in that module's info file (presumably because it has been pulled from the remote repo).
Even better would be the ability to specify a required version, but I don't know how hard something like this would be to implement...
dependencies[] = somemodule(>7.x-1.0-alpha2, >d1227523bcd09ab974551edf6435ebde01beb7c1)
Thanks.
Comments
Comment #1
tr commentedLike you said, 7.x-1.x (for example) does not indicate a specific version of a module; the 7.x-1.x branch could refer to ANY checkout of 7.x-1.x, whether it's new or old. In my mind, a dependency MUST be keyed to a specific version.
I would support something like your last example, because a commit ID can be used to uniquely specify a module's state, unlike a branch name (e.g. 7.x.-1.x). I don't necessarily think it's a good idea to depend on a specific commit, because if the author of the module that is depended on thought there was something special about that commit, there would/should be a tag that you could add to the dependencies.
Regardless, new features must go into Drupal 9 at this point, because we're past feature freeze for D8 and long past for D7.
Comment #2
catchThis might be won't fix, but either way it could happen in a minor release, if at all.
Comment #18
quietone commentedThis can now be done using a composer.json file in an extension.