Skip to content

Commit

Permalink
Fixes #21669 - Use $major on CentOS media, $version deprecated
Browse files Browse the repository at this point in the history
As we can see, CentOS fixed their repos so that
http://mirror.centos.org/centos/7 returns the latest version we need for
vmlinuz, etc..
For a long time they only offered these files under specific version
dirs, but now they have deprecated this and we should just refer to
$major, not $major.$minor
See the notice at http://mirror.centos.org/centos/7.3.1611/readme
  • Loading branch information
dLobatog authored and tbrisker committed Nov 22, 2017
1 parent 3e94c50 commit 0f118fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions db/migrate/20171121082256_update_centos_installation_media.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class UpdateCentosInstallationMedia < ActiveRecord::Migration
def change
Medium.unscoped.where(
:name => 'CentOS mirror',
:os_family => 'Redhat',
:path => 'http://mirror.centos.org/centos/$version/os/$arch'
).update_all(:path => 'http://mirror.centos.org/centos/$major/os/$arch')
end
end
2 changes: 1 addition & 1 deletion db/seeds.d/100-installation_media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Installation media: default mirrors
Medium.without_auditing do
[
{ :name => "CentOS mirror", :os_family => "Redhat", :path => "http://mirror.centos.org/centos/$version/os/$arch" },
{ :name => "CentOS mirror", :os_family => "Redhat", :path => "http://mirror.centos.org/centos/$major/os/$arch" },
{ :name => "Debian mirror", :os_family => "Debian", :path => "http://ftp.debian.org/debian" },
{ :name => "Fedora mirror", :os_family => "Redhat", :path => "http://dl.fedoraproject.org/pub/fedora/linux/releases/$major/Server/$arch/os/" },
{ :name => "Fedora Atomic mirror", :os_family => "Redhat", :path => "http://dl.fedoraproject.org/pub/alt/atomic/stable/Cloud_Atomic/$arch/os/" },
Expand Down

0 comments on commit 0f118fd

Please sign in to comment.