wok-next rev 8090

mirror-tools: dir-generator.php uses mirros files
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jan 22 13:57:31 2011 +0100 (2011-01-22)
parents 330a38ce55dc
children 07e986718a5f
files mirror-tools/stuff/var/www/slitaz/mirror/dir-generator.php mirror-tools/stuff/var/www/slitaz/mirror/floppies/builder/index.php mirror-tools/stuff/var/www/slitaz/mirror/mirrors
line diff
     1.1 --- a/mirror-tools/stuff/var/www/slitaz/mirror/dir-generator.php	Sat Jan 22 04:28:47 2011 +0000
     1.2 +++ b/mirror-tools/stuff/var/www/slitaz/mirror/dir-generator.php	Sat Jan 22 13:57:31 2011 +0100
     1.3 @@ -1,4 +1,20 @@
     1.4  <?php
     1.5 +function redirect()
     1.6 +{
     1.7 +?>
     1.8 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     1.9 +	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    1.10 +<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
    1.11 +<head>
    1.12 +	<title>SliTaz mirror redirection</title>
    1.13 +	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    1.14 +	<meta name="description" content="slitaz mirror redirection" />
    1.15 +	<meta name="robots" content="index, nofollow" />
    1.16 +	<meta name="author" content="SliTaz Contributors" />
    1.17 +	<meta http-equiv="Refresh" content="0;url=http://mirror.slitaz.org/">
    1.18 +</head>
    1.19 +<?php
    1.20 +}
    1.21  
    1.22  $VERSION = "0.2-slitaz";
    1.23  
    1.24 @@ -43,7 +59,8 @@
    1.25  
    1.26  // Can't call the script directly since REQUEST_URI won't be a directory
    1.27  if($_SERVER['PHP_SELF'] == '/'.$path) {
    1.28 -	die("Unable to call " . $path . " directly.");
    1.29 +	redirect();
    1.30 +//	die("Unable to call " . $path . " directly.");
    1.31  }
    1.32  
    1.33  
    1.34 @@ -195,19 +212,19 @@
    1.35  		<p><img src="/css/pics/website/network.png" 
    1.36  			alt=".png" style="vertical-align:middle;"/>Mirrors: 
    1.37  EOT;
    1.38 -	$mirrors = array(
    1.39 -	"switch.ch"     => "http://mirror.switch.ch/ftp/mirror/slitaz/",
    1.40 -	"gatech.edu"    => "http://www.gtlib.gatech.edu/pub/slitaz/",
    1.41 -	"tuxfamily.org" => "http://download.tuxfamily.org/slitaz/",
    1.42 -	"lupaworld.com" => "http://mirror.lupaworld.com/slitaz/",
    1.43 -	"ufpr.br"       => "http://slitaz.c3sl.ufpr.br/",
    1.44 -	"pina.si"       => "ftp://ftp.pina.si/slitaz/",
    1.45 -	"ibiblio.org"   => "http://distro.ibiblio.org/pub/linux/distributions/slitaz/",
    1.46 -	"vim.org"       => "http://ftp.vim.org/ftp/os/Linux/distr/slitaz/",
    1.47 -	"nedit.org"     => "http://ftp.nedit.org/ftp/ftp/pub/os/Linux/distr/slitaz/",
    1.48 -	"xemacs.org"    => "http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/",
    1.49 -	"garr.it"       => "http://slitaz.mirror.garr.it/mirrors/slitaz/",
    1.50 -	);
    1.51 +	$mirrors = array();
    1.52 +	$fp = @fopen(dirname($_SERVER["SCRIPT_FILENAME"])."/mirrors","r");
    1.53 +	if ($fp) {
    1.54 +		while (($line = fgets($fp)) !== false) {
    1.55 +			$line = chop($line);
    1.56 +			$url = parse_url($line);
    1.57 +			if ($_SERVER["SERVER_NAME"] == $url['host']) continue;
    1.58 +			$host = explode('.',$url['host']);
    1.59 +			$mirrors[$host[count($host)-2].".".
    1.60 +			         $host[count($host)-1]] = $line;
    1.61 +		}
    1.62 +	}
    1.63 +	fclose($fp);
    1.64  	foreach($mirrors as $name => $url) {
    1.65  		echo "<a href=\"$url$vpath\" title=\"$name mirror\">$name</a>\n";
    1.66  	}
     2.1 --- a/mirror-tools/stuff/var/www/slitaz/mirror/floppies/builder/index.php	Sat Jan 22 04:28:47 2011 +0000
     2.2 +++ b/mirror-tools/stuff/var/www/slitaz/mirror/floppies/builder/index.php	Sat Jan 22 13:57:31 2011 +0100
     2.3 @@ -1,4 +1,19 @@
     2.4  <?php
     2.5 +if (false) { // no php support on this mirror !
     2.6 +?>
     2.7 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     2.8 +	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2.9 +<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
    2.10 +<head>
    2.11 +	<title>SliTaz Boot Floppies redirection</title>
    2.12 +	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    2.13 +	<meta name="description" content="slitaz boot floppies builder redirection" />
    2.14 +	<meta name="robots" content="index, nofollow" />
    2.15 +	<meta name="author" content="SliTaz Contributors" />
    2.16 +	<meta http-equiv="Refresh" content="0;url=http://mirror.slitaz.org/floppies/builder/index.php">
    2.17 +</head>
    2.18 +<?php
    2.19 +}
    2.20  ini_set('upload_max_filesize','16M');
    2.21  ini_set('post_max_size','16M');
    2.22  if (isset($_GET['id']) && is_file("/tmp/".$_GET['id']."/fd")) {
    2.23 @@ -190,6 +205,8 @@
    2.24  		switch ($_POST['size']) {
    2.25  		case 1763328 : 
    2.26  		case 2015232 : 
    2.27 +		case 3526656 :
    2.28 +		case 4030464 :
    2.29  			$cmd .= " --tracks 82"; break;
    2.30  		case 1784832 : 
    2.31  			$cmd .= " --tracks 83"; break;
    2.32 @@ -203,11 +220,15 @@
    2.33  		}
    2.34  	}
    2.35  	$sizes = array(
    2.36 +		"368640" => "360 KB",   "737280" => "720 KB",
    2.37 +		"1228800" => "1.20 MB",
    2.38  		"1474560" => "1.44 MB", "1638400" => "1.60 MB",
    2.39  		"1720320" => "1.68 MB", "1763328" => "1.72 MB",
    2.40  		"1784832" => "1.74 MB", "1802240" => "1.76 MB",
    2.41  		"1884160" => "1.84 MB", "1966080" => "1.92 MB", 
    2.42  		"2015232" => "1.96 MB", "2949120" => "2.88 MB",
    2.43 +		"3440640" => "3.36 MB", "3526656" => "3.44 MB",
    2.44 +		"3932160" => "3.84 MB", "4030464" => "3.92 MB",
    2.45  		"0"       => "no limit"
    2.46  	);
    2.47  
    2.48 @@ -319,7 +340,7 @@
    2.49  			$options[-3] = "Ask";
    2.50  			$options[-2] = "Ext";
    2.51  			$options[-1] = "Std";
    2.52 -			for ($i = 0; $i < 32; $i++) $options[$i] = $i;
    2.53 +			for ($i = 0; $i < 64; $i++) $options[$i] = $i;
    2.54  			foreach ($options as $key => $value) {
    2.55  				echo '<option value="'.$key.'"';
    2.56  				if ($key == $selected || $value == $selected)
    2.57 @@ -335,7 +356,9 @@
    2.58  	<td><select name="size">
    2.59  <?php
    2.60  	foreach ($sizes as $key => $value) {
    2.61 -		echo "		<option value=\"$key\">$value</option>\n";
    2.62 +		echo "		<option value=\"$key\"";
    2.63 +		if ($key == "1474560") echo " selected='selected'";
    2.64 +		echo ">$value</option>\n";
    2.65  	}
    2.66  ?>
    2.67  	</select>
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/mirror-tools/stuff/var/www/slitaz/mirror/mirrors	Sat Jan 22 13:57:31 2011 +0100
     3.3 @@ -0,0 +1,10 @@
     3.4 +http://mirror.slitaz.org/
     3.5 +http://mirror.switch.ch/ftp/mirror/slitaz/
     3.6 +http://www.gtlib.gatech.edu/pub/slitaz/
     3.7 +http://download.tuxfamily.org/slitaz/
     3.8 +http://mirror.lupaworld.com/slitaz/
     3.9 +http://slitaz.c3sl.ufpr.br/
    3.10 +ftp://ftp.pina.si/slitaz/
    3.11 +http://distro.ibiblio.org/pub/linux/distributions/slitaz/
    3.12 +http://ftp.ch.xemacs.org/ftp/pool/2/mirror/slitaz/
    3.13 +http://slitaz.mirror.garr.it/mirrors/slitaz/