diff options
| author | Remi Collet <remi@remirepo.net> | 2025-02-02 16:33:01 +0100 | 
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2025-02-02 16:33:01 +0100 | 
| commit | 604afb6a47b39442ce25e64dc9b93b33b6122e19 (patch) | |
| tree | a13230a1f186264d9a630c7aec7e1aab8c9bd152 | |
| parent | 706359a1e387410210a27f9eddfdc42086a09027 (diff) | |
more param to check
| -rwxr-xr-x | check.php | 29 | 
1 files changed, 26 insertions, 3 deletions
@@ -35,17 +35,18 @@ if ($cli) {  <?php  }  $repos = [ +	'enterprise/10'	=> 'Enterprise Linux 10',  	'enterprise/9'	=> 'Enterprise Linux 9',  	'enterprise/8'	=> 'Enterprise Linux 8', -	'enterprise/7'	=> 'Enterprise Linux 7',  	'fedora/41' 	=> 'Fedora 41',  	'fedora/40' 	=> 'Fedora 40',  	'fedora/39' 	=> 'Fedora 39',  ];  $subs = [ +	'modular',  	'remi', +	'safe',  	'test', -	'php56',  ];  $archs = [  	'i386', @@ -209,6 +210,18 @@ if (isset($_GET['arch']) && in_array($_GET['arch'], $archs)) {  } else {  	$arch = 'x86_64';  } +if (isset($_SERVER['argv'][1]) && isset($repos[$_SERVER['argv'][1]])) { +	$path = $_SERVER['argv'][1]; +	array_shift($_SERVER['argv']); +} +if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $subs)) { +	$repo = $_SERVER['argv'][1]; +	array_shift($_SERVER['argv']); +} +if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $archs)) { +	$arch = $_SERVER['argv'][1]; +	array_shift($_SERVER['argv']); +}  $name = $repos[$path];  $full = "$path/$repo/$arch"; @@ -248,6 +261,16 @@ if ($ref) {  						$tocheck[] = $mirror;  					}  				} +				foreach ($mirrors as $testing) { +					if (preg_match('|'.$_SERVER['argv'][1].'|', $mirror)) { +						$tocheck[] = $mirror; +					} +				} +				foreach ($mirrors as $disabled) { +					if (preg_match('|'.$_SERVER['argv'][1].'|', $mirror)) { +						$tocheck[] = $mirror; +					} +				}  				if (empty($tocheck)) {  					$tocheck[] = $_SERVER['argv'][1];  				} @@ -255,7 +278,7 @@ if ($ref) {  	} else {  		$tocheck = array_merge($mirrors, $testing);  	} -	printf(($cli ? "Check %d mirror(s) of %s (%s)\n" : "<h3>%s - %s</h3>\n"), count($tocheck), $name, date('r', $ref)); +	printf(($cli ? "Check %d mirror(s) of %s (%s, %s)\n" : "<h3>%s - %s</h3>\n"), count($tocheck), $name, $full, date('r', $ref));  	foreach ($tocheck as $mirror) {  		if ($cli) {  			$pid = pcntl_fork();  | 
