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

main
Jordi Boggiano 12 years ago
parent 5b1782970f
commit 8a35353e8d

@ -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');
}

Loading…
Cancel
Save