-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating template/composer.json to use Drupal packagist constraints. #762
Conversation
Todo:
|
e8f6d95
to
acc664d
Compare
// 8.1.0-alpha1 > 1.0.0-alpha1 | ||
// 8.1.0-beta12 > 1.0.0-beta12 | ||
// 8.12.0-rc22 > 12.0.0-rc22 | ||
if (preg_match('/^([\^~])?8(\.)?(\d+)?(\.\d+)?(-(alpha|beta|rc)\d+)?(\.\*)?(@(dev|alpha|beta|rc))?/', $version_constraint, $matches)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to also cover refs and "dev-" prefixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to support more operators:
https://getcomposer.org/doc/articles/versions.md#range
|
||
// dev-master => master-dev | ||
// dev-something#123abc => something-dev#123abc | ||
if (preg_match('/^dev-([A-Za-z0-9-]+)(#[0-9a-f]+)?/', $version_constraint, $matches)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't account for the possibility of underscores in the branch name.
function convert_version_constraint($version_constraint) { | ||
|
||
// 8.* => * | ||
if (preg_match('/8\.\*$/', $version_constraint)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no anchor at the beginning, so won't this also match something like 1.8.*?
We ended up tweaking the output for branches a little bit to:
See here: https://github.com/acquia/lightning/blob/8.x-1.x/src/UpgradeBuild.php |
1f604de
to
677f305
Compare
…gist constraints.
677f305
to
11f7737
Compare
No description provided.