Fix updating of already installed dev packages, fixes #496

main
Jordi Boggiano 12 years ago
parent 2844a5673d
commit ceac0ca75b

@ -219,10 +219,6 @@ class Installer
// force dev packages to be updated to latest reference on update
if ($this->update) {
foreach ($localRepo->getPackages() as $package) {
if ($package instanceof AliasPackage) {
$package = $package->getAliasOf();
}
// skip non-dev packages
if (!$package->isDev()) {
continue;
@ -230,8 +226,8 @@ class Installer
// skip packages that will be updated/uninstalled
foreach ($operations as $operation) {
if (('update' === $operation->getJobType() && $package === $operation->getInitialPackage())
|| ('uninstall' === $operation->getJobType() && $package === $operation->getPackage())
if (('update' === $operation->getJobType() && $operation->getInitialPackage()->equals($package))
|| ('uninstall' === $operation->getJobType() && $operation->getPackage()->equals($package))
) {
continue 2;
}

@ -141,7 +141,7 @@ class InstallationManager
if ($initial instanceof AliasPackage) {
$initial = $initial->getAliasOf();
}
$target = $operation->getTargetPackage();
$target = $operation->getTargetPackage();
if ($target instanceof AliasPackage) {
$target = $target->getAliasOf();
$target->setInstalledAsAlias(true);

@ -165,6 +165,18 @@ abstract class BasePackage implements PackageInterface
return $this->getName().'-'.$this->getVersion();
}
public function equals(PackageInterface $package)
{
$self = $this;
if ($this instanceof AliasPackage) {
$self = $this->getAliasOf();
}
if ($package instanceof AliasPackage) {
$package = $package->getAliasOf();
}
return $package === $self;
}
/**
* Converts the package into a readable and unique string
*

Loading…
Cancel
Save