We mark packages as uninstallable by removing them from the repo
As it is faster to remove packages from the repos and keep them out of the package pool to begin with, we don't need an installable() method on the policy.pull/715/head
parent
8fc09afbae
commit
bd66c27ff6
|
@ -43,12 +43,6 @@ class DefaultPolicy implements PolicyInterface
|
|||
return $packages;
|
||||
}
|
||||
|
||||
public function installable(Solver $solver, Pool $pool, array $installedMap, PackageInterface $package)
|
||||
{
|
||||
// todo: package blacklist?
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getPriority(Pool $pool, PackageInterface $package)
|
||||
{
|
||||
return $pool->getPriority($package->getRepository());
|
||||
|
|
|
@ -22,6 +22,5 @@ interface PolicyInterface
|
|||
{
|
||||
function versionCompare(PackageInterface $a, PackageInterface $b, $operator);
|
||||
function findUpdatePackages(Pool $pool, array $installedMap, PackageInterface $package);
|
||||
function installable(Solver $solver, Pool $pool, array $installedMap, PackageInterface $package);
|
||||
function selectPreferedPackages(Pool $pool, array $installedMap, array $literals);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ class Rule
|
|||
const RULE_JOB_INSTALL = 2;
|
||||
const RULE_JOB_REMOVE = 3;
|
||||
const RULE_JOB_LOCK = 4;
|
||||
const RULE_NOT_INSTALLABLE = 5;
|
||||
const RULE_PACKAGE_CONFLICT = 6;
|
||||
const RULE_PACKAGE_REQUIRES = 7;
|
||||
const RULE_PACKAGE_OBSOLETES = 8;
|
||||
|
@ -200,9 +199,6 @@ class Rule
|
|||
case self::RULE_JOB_LOCK:
|
||||
return "Lock command rule ($ruleText)";
|
||||
|
||||
case self::RULE_NOT_INSTALLABLE:
|
||||
return $ruleText;
|
||||
|
||||
case self::RULE_PACKAGE_CONFLICT:
|
||||
$package1 = $this->literals[0]->getPackage();
|
||||
$package2 = $this->literals[1]->getPackage();
|
||||
|
|
|
@ -198,11 +198,6 @@ class Solver
|
|||
|
||||
$this->addedMap[$package->getId()] = true;
|
||||
|
||||
if (!$this->policy->installable($this, $this->pool, $this->installedMap, $package)) {
|
||||
$this->addRule(RuleSet::TYPE_PACKAGE, $this->createRemoveRule($package, Rule::RULE_NOT_INSTALLABLE, (string) $package));
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($package->getRequires() as $link) {
|
||||
$possibleRequires = $this->pool->whatProvides($link->getTarget(), $link->getConstraint());
|
||||
|
||||
|
|
Loading…
Reference in New Issue