diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2015-02-07 19:21:19 +0100 |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2015-02-07 19:21:19 +0100 |
commit | 9a3fe2aacd6baf9a63da12fc8b9e14abc559a606 (patch) | |
tree | 6bf0034540c147da2dfe2f193eb9d028d31559ce | |
parent | 2f8b1036da42ec3d15a51c6b17a473f9f4df71d3 (diff) |
Complete the repositories section in composer.json during update
-rwxr-xr-x | bin/update.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/update.sh b/bin/update.sh index 26314408c..1dfaa961d 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -181,6 +181,27 @@ if ($RCI->configured) { */ } + // update the repositories section with the new dependencies + if (is_array($composer_template['repositories'])) { + if (!is_array($composer_data['repositories'])) { + $composer_data['repositories'] = array(); + } + + foreach ($composer_template['repositories'] as $repo) { + $rkey = $repo['type'] . $repo['url'] . $repo['package']['name']; + $existing = false; + foreach ($composer_data['repositories'] as $_repo) { + if ($rkey == $_repo['type'] . $_repo['url'] . $_repo['package']['name']) { + $existing = true; + break; + } + } + if (!$existing) { + $composer_data['repositories'][] = $repo; + } + } + } + // use the JSON encoder from the Composer package if (is_file('composer.phar')) { include 'phar://composer.phar/src/Composer/Json/JsonFile.php'; |