|
@@ -147,12 +147,10 @@ class DownloadManager
|
|
$sourceType = $package->getSourceType();
|
|
$sourceType = $package->getSourceType();
|
|
$distType = $package->getDistType();
|
|
$distType = $package->getDistType();
|
|
|
|
|
|
- if ((!$package->isDev() || $this->preferDist) && !($preferSource && $sourceType) && $distType) {
|
|
|
|
|
|
+ if ((!$package->isDev() || $this->preferDist || !$sourceType) && !($preferSource && $sourceType) && $distType) {
|
|
$package->setInstallationSource('dist');
|
|
$package->setInstallationSource('dist');
|
|
} elseif ($sourceType) {
|
|
} elseif ($sourceType) {
|
|
$package->setInstallationSource('source');
|
|
$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 {
|
|
} else {
|
|
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
|
|
throw new \InvalidArgumentException('Package '.$package.' must have a source or dist specified');
|
|
}
|
|
}
|