Merge branch '1.6'
commit
464daeebe2
|
@ -678,9 +678,7 @@
|
|||
{ "$ref": "#/definitions/inline-package" },
|
||||
{
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": { "$ref": "#/definitions/inline-package" }
|
||||
}
|
||||
"items": { "$ref": "#/definitions/inline-package" }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ use Composer\DependencyResolver\DefaultPolicy;
|
|||
use Composer\DependencyResolver\Operation\UpdateOperation;
|
||||
use Composer\DependencyResolver\Operation\InstallOperation;
|
||||
use Composer\DependencyResolver\Operation\UninstallOperation;
|
||||
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
|
||||
use Composer\DependencyResolver\Operation\OperationInterface;
|
||||
use Composer\DependencyResolver\PolicyInterface;
|
||||
use Composer\DependencyResolver\Pool;
|
||||
|
@ -716,6 +717,10 @@ class Installer
|
|||
foreach ($devPackages as $pkg) {
|
||||
$packagesToSkip[$pkg->getName()] = true;
|
||||
if ($installedDevPkg = $localRepo->findPackage($pkg->getName(), '*')) {
|
||||
if ($installedDevPkg instanceof AliasPackage) {
|
||||
$finalOps[] = new MarkAliasUninstalledOperation($installedDevPkg, 'non-dev install removing it');
|
||||
$installedDevPkg = $installedDevPkg->getAliasOf();
|
||||
}
|
||||
$finalOps[] = new UninstallOperation($installedDevPkg, 'non-dev install removing it');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,13 +167,6 @@ class ArrayRepository extends BaseRepository
|
|||
{
|
||||
$packageId = $package->getUniqueName();
|
||||
|
||||
if ($package instanceof AliasPackage) {
|
||||
$aliasedPackage = $package->getAliasOf();
|
||||
if ($this === $aliasedPackage->getRepository()) {
|
||||
$this->removePackage($aliasedPackage);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->getPackages() as $key => $repoPackage) {
|
||||
if ($packageId === $repoPackage->getUniqueName()) {
|
||||
array_splice($this->packages, $key, 1);
|
||||
|
|
|
@ -68,7 +68,7 @@ class ArrayRepositoryTest extends TestCase
|
|||
$this->assertEquals('bar', $bar[0]->getName());
|
||||
}
|
||||
|
||||
public function testAutomaticallyAddAndRemoveAliasedPackage()
|
||||
public function testAutomaticallyAddAliasedPackageButNotRemove()
|
||||
{
|
||||
$repo = new ArrayRepository();
|
||||
|
||||
|
@ -83,7 +83,7 @@ class ArrayRepositoryTest extends TestCase
|
|||
|
||||
$repo->removePackage($alias);
|
||||
|
||||
$this->assertCount(0, $repo);
|
||||
$this->assertCount(1, $repo);
|
||||
}
|
||||
|
||||
public function testSearch()
|
||||
|
|
Loading…
Reference in New Issue