From c2aa6e258393542bf149427cb581f634b25577ef Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Mon, 30 May 2016 00:07:01 +0200 Subject: Yum style repo list (workaround until mirrorbrain is setup) use setup from mageia.org/downloads todo: check variables --- mirrorlist/index.php | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mirrorlist/index.php diff --git a/mirrorlist/index.php b/mirrorlist/index.php new file mode 100644 index 000000000..69614a769 --- /dev/null +++ b/mirrorlist/index.php @@ -0,0 +1,65 @@ + $v) { +$getvar = get("$key"); + +$list = implode(", ", $v); + if (in_array($getvar, $v)) { + $out = array($key => $getvar); + }else{ + $out = array("Error" => "Error $key: $getvar - not in list - $list"); + break; + } +} + return $out; +} + + + +$source = $debug = false; + +$release = get('release'); +$arch = get('arch'); +$section = get('section'); +$repo = get('repo'); +$debug = get('debug'); +$source = get('source'); + +$wsd = new Downloads(); +$dl = $wsd->prepare_download(true, null); + +$arraycheck =array( +'release' => array('5', '6', 'cauldron'), +'arch' => array('i586', 'x86_64', 'SRPMS', 'armv5tl', 'armv7hl'), +'section' => array('core', 'nonfree', 'tainted'), +'repo' => array('release', 'updates', 'updates_testing', 'backports', 'backports_testing'), +); + +if ($source){ + $link = "MIRROR/distrib/$release/SRPMS/media/$section/$repo/"; +}elseif ($debug){ + $link = "MIRROR/distrib/$release/$arch/media/debug/$section/$repo/"; +}else{ + $link = "MIRROR/distrib/$release/$arch/media/$section/$repo/"; +} + + +if ($release && $arch && $section && $repo){ + + $out = str_replace('MIRROR', $dl['mirror_url'], $link); + //$out = check($arraycheck); + //print_r($out); +}else{ + $out = "Invalid options"; +} +echo $out; + -- cgit v1.2.1