diff --git a/centos.php b/centos.php index 2e540b7..6b8f6d4 100644 --- a/centos.php +++ b/centos.php @@ -51,6 +51,9 @@ $mirrors = array('http://vault.centos.org/'); } else { $mirrors = get_centos_mirrors($release, $arch); + if(empty($mirrors)) { + $mirrors = array('http://mirror.centos.org/centos'); + } } foreach($mirrors as $mirror) { diff --git a/config.php b/config.php index a33e516..88af9fa 100644 --- a/config.php +++ b/config.php @@ -50,9 +50,12 @@ ); -// Alternative architectures: -// - stable goes to mirror, -// - development goes to packages.nethserver.org +// Architectures: +// +// - "stable" goes to the official NS mirror infrastructure +// +// - "development" goes to mirror.nethserver.org +// $stable_arches = array( 'x86_64', ); diff --git a/cron.php b/cron.php index cd2d154..362438f 100644 --- a/cron.php +++ b/cron.php @@ -32,7 +32,12 @@ $major_releases = array_unique(preg_replace('/^(\d).*/', '$1', $stable_releases)); foreach($major_releases as $release) { - foreach($stable_arches as $arch) { + foreach(array_merge($stable_arches, $development_arches) as $arch) { + // skip altarch for 6 branch + if($release == '6' && $arch != 'x86_64') { + continue; + } + $status = refresh_centos_mirrors_cache($ce_mirror_countries, $release, $arch); if( ! $status) { error_log("[ERROR] Failed to write $release $arch cache file"); diff --git a/mirrorcache.php b/mirrorcache.php index e893ebd..a8c6193 100644 --- a/mirrorcache.php +++ b/mirrorcache.php @@ -77,6 +77,5 @@ function get_centos_mirrors($release, $arch) $mirrors = array(); } - // fallback to default mirrorlist or return valid entries - return empty($mirrors) ? array('http://mirror.centos.org/centos') : $mirrors; + return $mirrors; } diff --git a/nethserver.php b/nethserver.php index 903d931..4f09644 100644 --- a/nethserver.php +++ b/nethserver.php @@ -91,10 +91,22 @@ // map to real repository name, extracting the $repo_suffix (required by SCLo): list($repo, $repo_suffix) = array_merge(explode('-', $ce_repos[$repo], 2), array('')); if(in_array($nsrelease, $vault_releases)) { - $mirrors = array('http://vault.centos.org'); + // CentOS versions served by vault.centos.org + if($arch == 'x86_64') { + $mirrors = array('http://vault.centos.org/centos'); + } else { + $mirrors = array('http://vault.centos.org/altarch'); + } } else { // CentOS versions served by upstream mirror infrastructure $mirrors = get_centos_mirrors($release, $arch); + if(empty($mirrors)) { + if($arch == 'x86_64') { + $mirrors = array('http://mirror.centos.org/centos'); + } else { + $mirrors = array('http://mirror.centos.org/altarch'); + } + } } } else { // Serverd only by the NethServer master mirror