aboutsummaryrefslogtreecommitdiffstats
path: root/tools/update-mirrors-list.php
blob: 3b65c6529c14250972e1291cdea6d4a865d3bb69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/**
 * Run this to update lib/cached.list.php and cached.list_doc.php mirrors list from mirrors.mageia.org/api
 *
 * Usage from the git clone root location:
 * php ./tools/update-mirrors-list.php
 *
*/

require __DIR__ . '/../lib/Downloads.php';

echo 'Rebuilding ./lib/cached.list.php with one torrent file as a test file.' . PHP_EOL;
Downloads::get_all_mirrors(false);
echo PHP_EOL . PHP_EOL;

echo 'Rebuilding ./lib/cached.list_doc.php with the date.txt as a test file.' . PHP_EOL;
Downloads::get_all_mirrors(false, true);
echo PHP_EOL . PHP_EOL;

echo 'Rebuilding ./lib/cached.list_mirrorlist.php with the repomd.xml as a test file.' . PHP_EOL;
Downloads::get_all_mirrors(false, false, true);