commit
8d4ccd4af6
|
@ -91,19 +91,18 @@ EOT
|
||||||
|
|
||||||
foreach ($installedPackages as $package) {
|
foreach ($installedPackages as $package) {
|
||||||
if ($package->getName() === $link->getTarget()) {
|
if ($package->getName() === $link->getTarget()) {
|
||||||
$request->update($link->getTarget(), $link->getConstraint());
|
$constraint = new VersionConstraint('=', $package->getVersion());
|
||||||
continue 2;
|
if ($link->getConstraint()->matches($constraint)) {
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
// TODO this should just update to the exact version (once constraints are available on update, see #125)
|
||||||
|
$request->remove($package->getName(), $constraint);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$request->install($link->getTarget(), $link->getConstraint());
|
$request->install($link->getTarget(), $link->getConstraint());
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($localRepo->getPackages() as $package) {
|
|
||||||
if (!in_array($package->getName(), $listedPackages)) {
|
|
||||||
$request->remove($package->getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} elseif ($composer->getLocker()->isLocked()) {
|
} elseif ($composer->getLocker()->isLocked()) {
|
||||||
$output->writeln('> Found lockfile. Reading.');
|
$output->writeln('> Found lockfile. Reading.');
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,8 @@ class LibraryInstaller implements InstallerInterface
|
||||||
public function uninstall(PackageInterface $package)
|
public function uninstall(PackageInterface $package)
|
||||||
{
|
{
|
||||||
if (!$this->repository->hasPackage($package)) {
|
if (!$this->repository->hasPackage($package)) {
|
||||||
|
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
|
||||||
|
return;
|
||||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,8 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$library->uninstall($package);
|
$library->uninstall($package);
|
||||||
|
|
||||||
$this->setExpectedException('InvalidArgumentException');
|
// TODO re-enable once #125 is fixed and we throw exceptions again
|
||||||
|
// $this->setExpectedException('InvalidArgumentException');
|
||||||
|
|
||||||
$library->uninstall($package);
|
$library->uninstall($package);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue