// $Id$
?>
Easy Urpmi
include("urpmiweb.inc");
$list_mdkver='';
$list_location='';
function parse_line($liste_line)
{
global $list_arch;
global $list_mdkver;
global $list_location;
global $user;
global $list;
global $mach;
if (!is_array($liste_line)) return;
while (list($key,$val)=each($liste_line))
{
$list_arch[$val['arch']]=1;
$list_mdkver[$val['mdkver']]=1;
switch ($val['arch'])
{
case "*":
case "noarch":
case $user['arch']:
break;
default:
$val['url']="";
}
switch ($val['mdkver'])
{
case "*":
case $user['mdkver']:
break;
default:
$val['url']="";
}
$mach=parse_url($val['url']);
if ($val['location']) $val['location']= " (".$val['location'].")";
else $val['location']="";
if (strlen($val['location'])>$list_location[$mach["host"]]) $list_location[$mach["host"]] = $val['location'];
if ($val['url']) $list[$val['name']][$mach["host"]]=$val['url'];
}
}
if (!$user['mdkver']) $user['mdkver']="9.0";
if (!$user['arch']) $user['arch']='i586';
$d=opendir("mirror.list");
if ($d)
{
while (($file=readdir($d))!==false)
{
if ($file != "." && $file != "..")
parse_line(parse_liste("mirror.list/".$file));
}
closedir($d);
}
echo "Easy urpmi config for Mandrake
\n";
echo "\n";
?>A '*' will select only source can be apply to all
echo "\n2) For each source select a mirror
";
?>It will give you the right command to use to setup urpmi
echo "";
}
else
{
echo "I am very sorry, there are no mirror available for your system
";
}
?>
If you're unable to find your mirror, mail me, I will add it.
Report me error too, Thanks, enjoy :)
Olivier Thauvin
This soft is under GPL
Original site
$Id$