From bbe7b61b4df4d36ae941a5f3526b041e6319b6ba Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Fri, 14 Oct 2016 00:32:07 +0200 Subject: [PATCH] Fix composer branch-alias constraint --- commands/make/make.drush.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/make/make.drush.inc b/commands/make/make.drush.inc index be08e57474..890689ccea 100644 --- a/commands/make/make.drush.inc +++ b/commands/make/make.drush.inc @@ -502,9 +502,11 @@ function drush_make_convert_composer_to_make($composer_lock, $composer_json) { $group[$project_name]['download']['url'] = $package['source']['url']; // Dev versions should use git branch + revision, otherwise a tag is used. if (strstr($package['version'], 'dev')) { - // Change 'dev-' prefix to '-dev' suffix. + // 'dev-' prefix indicates a branch-alias. Stripping the dev prefix from + // the branch name is sufficient. + // @see https://getcomposer.org/doc/articles/aliases.md if (strpos($package['version'], 'dev-') === 0) { - $group[$project_name]['download']['branch'] = str_replace('dev-', '', $package['version']) . '-dev'; + $group[$project_name]['download']['branch'] = substr($package['version'], 4); } // Otherwise, leave as is. Version may already use '-dev' suffix. else {