diff -Nur smeserver-yum-2.6.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL smeserver-yum-2.6.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL --- smeserver-yum-2.6.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 1969-12-31 19:00:00.000000000 -0500 +++ smeserver-yum-2.6.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2019-12-05 10:15:48.300000000 -0500 @@ -0,0 +1,20 @@ +{ + use POSIX qw(strftime); + use File::Slurp; + #get CentOS release we are + my $SUBVER = read_file('/etc/centos-release'); + $SUBVER =~ s/^CentOS Linux release ([0-9\.]+).*?$/$1/; + return unless $1; + my $curdate = strftime '%Y%m%d', localtime; + # return unless EOL is reached + return unless ( "$curdate" >= "20240630"); + for my $name ( qw(base updates centosplus extras fasttrack) ) + { + my $repo = $DB->get($name) or next; + my $rname = ( $name eq 'base' )? 'os' :$name; + # setprop BaseURL "http://vault.centos.org/$SUBVER/$rname/\$basearch/" + $repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$rname/\$basearch/"); + # delprop MirrorList + $repo->delete_prop('MirrorList'); + } +}