<?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);