1
0
Fork 0

Allow dist installs for dev packages that do not have a source setup

pull/1155/head
Jordi Boggiano 2012-09-27 19:00:06 +02:00
parent 5b1782970f
commit 8a35353e8d
1 changed files with 1 additions and 3 deletions

View File

@ -147,12 +147,10 @@ class DownloadManager
$sourceType = $package->getSourceType();
$distType = $package->getDistType();
if ((!$package->isDev() || $this->preferDist) && !($preferSource && $sourceType) && $distType) {
if ((!$package->isDev() || $this->preferDist || !$sourceType) && !($preferSource && $sourceType) && $distType) {
$package->setInstallationSource('dist');
} elseif ($sourceType) {
$package->setInstallationSource('source');
} elseif ($package->isDev() && $distType) {
throw new \InvalidArgumentException('Dev package '.$package.' should have a source specified because for dev packages dist is used only with --prefer-dist option');
} else {
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
}