Skip to content
Snippets Groups Projects
Commit f3d7be15 authored by Adam G-H's avatar Adam G-H
Browse files

Revert "Revert "Issue #3365133 by phenaproxima: Remove metapackage path...

Revert "Revert "Issue #3365133 by phenaproxima: Remove metapackage path workaround in ComposerInspector::getInstalledPackagesList() when Composer 2.5.7 or later is required""

This reverts commit 93df6d43.
parent b6d7a294
No related branches found
No related tags found
1 merge request!989Issue #3356804 by phenaproxima: Flag a warning during status check if the...
......@@ -328,22 +328,11 @@ class ComposerInspector implements LoggerAwareInterface {
// same as the working directory, in which case InstalledPackage::$path
// should be NULL. For all other package types, we consider it invalid
// if the install path is the same as the working directory.
// @todo Remove this handling of metapackage paths when Composer 2.5.7 or
// later is required, in https://drupal.org/i/3365133.
if (isset($package['type']) && $package['type'] === 'metapackage') {
// TRICKY: until Composer 2.5.6, metapackages returned the current
// working directory instead of NULL.
// @see https://github.com/composer/composer/commit/3a48e393756e8b0387925aa327f45a30128b4556
$packages_data[$name]['path'] = NULL;
// @todo Remove the if-branch when the minimum Composer version is raised to >=2.5.6.
if (Semver::satisfies($this->getVersion(), '<2.5.6')) {
if ($path !== $working_dir) {
throw new \UnexpectedValueException("Metapackage '$name' is installed at unexpected path: '$path', expected '$working_dir'");
}
}
elseif ($path !== NULL) {
if ($path !== NULL) {
throw new \UnexpectedValueException("Metapackage '$name' is installed at unexpected path: '$path', expected NULL");
}
$packages_data[$name]['path'] = $path;
}
elseif ($path === $working_dir) {
throw new \UnexpectedValueException("Package '$name' cannot be installed at path: '$path'");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment