Skip to content

Commit c604f88

Browse files
committed
Disallow alt for php-src
1 parent 83db186 commit c604f88

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config/source.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"license": {
55
"type": "file",
66
"path": "LICENSE"
7-
}
7+
},
8+
"alt": false
89
},
910
"amqp": {
1011
"type": "url",

src/SPC/command/DownloadCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,15 @@ public function handle(): int
245245
}
246246
// if download failed, we will try to download alternative sources
247247
logger()->warning("Download failed: {$e->getMessage()}");
248-
logger()->notice("Trying to download alternative sources for {$source}");
249248
$alt_sources = Config::getSource($source)['alt'] ?? null;
250249
if ($alt_sources === null) {
250+
logger()->warning("No alternative sources found for {$source}, using default alternative source");
251251
$alt_config = array_merge($config, $this->getDefaultAlternativeSource($source));
252-
} else {
252+
} elseif ($alt_sources === false) {
253+
logger()->warning("No alternative sources found for {$source}, skipping alternative download");
254+
throw $e;
255+
} else{
256+
logger()->notice("Trying to download alternative sources for {$source}");
253257
$alt_config = array_merge($config, $alt_sources);
254258
}
255259
Downloader::downloadSource($source, $alt_config, $force_all || in_array($source, $force_list));

0 commit comments

Comments
 (0)