Error out when a package can not be found, refs #30
parent
1a9de17a88
commit
2ebc795754
|
@ -76,8 +76,29 @@ EOT
|
||||||
$policy = new DependencyResolver\DefaultPolicy();
|
$policy = new DependencyResolver\DefaultPolicy();
|
||||||
$solver = new DependencyResolver\Solver($policy, $pool, $localRepo);
|
$solver = new DependencyResolver\Solver($policy, $pool, $localRepo);
|
||||||
|
|
||||||
// solve dependencies and execute operations
|
// solve dependencies
|
||||||
foreach ($solver->solve($request) as $operation) {
|
$operations = $solver->solve($request);
|
||||||
|
|
||||||
|
// check for missing deps
|
||||||
|
// TODO this belongs in the solver, but this will do for now to report top-level deps missing at least
|
||||||
|
foreach ($request->getJobs() as $job) {
|
||||||
|
if ('install' === $job['cmd']) {
|
||||||
|
foreach ($localRepo->getPackages() as $package) {
|
||||||
|
if ($job['packageName'] === $package->getName()) {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($operations as $operation) {
|
||||||
|
if ('install' === $operation->getJobType() && $job['packageName'] === $operation->getPackage()->getName()) {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new \UnexpectedValueException('Package '.$job['packageName'].' could not be resolved to an installable package.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// execute operations
|
||||||
|
foreach ($operations as $operation) {
|
||||||
$installationManager->execute($operation);
|
$installationManager->execute($operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue