1 |
diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL |
diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL |
2 |
--- smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 1969-12-31 19:00:00.000000000 -0500 |
--- smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 1969-12-31 19:00:00.000000000 -0500 |
3 |
+++ smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2019-12-05 10:15:48.300000000 -0500 |
+++ smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2019-12-05 10:15:48.300000000 -0500 |
4 |
@@ -0,0 +1,19 @@ |
@@ -0,0 +1,20 @@ |
5 |
+{ |
+{ |
6 |
+ use POSIX qw(strftime); |
+ use POSIX qw(strftime); |
7 |
+ use File::Slurp; |
+ use File::Slurp; |
12 |
+ my $curdate = strftime '%Y%m%d', localtime; |
+ my $curdate = strftime '%Y%m%d', localtime; |
13 |
+ # return unless EOL is reached |
+ # return unless EOL is reached |
14 |
+ return unless ( "$curdate" >= "20201130"); |
+ return unless ( "$curdate" >= "20201130"); |
15 |
+ for my $name ( qw(base updates centos-sclo-centos centos-sclo-rh centosplus extras fasttrack contrib) ) |
+ for my $name ( qw(base updates centosplus extras fasttrack contrib) ) |
16 |
+ { |
+ { |
17 |
+ my $repo = $DB->get($name) or next; |
+ my $repo = $DB->get($name) or next; |
18 |
+ # setprop BaseURL "http://vault.centos.org/$SUBVER/$name/\$basearch/" |
+ my $rname = ( $name eq 'base' )? 'os' :$name; |
19 |
+ #repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$name/\$basearch/"); |
+ # setprop BaseURL "http://vault.centos.org/$SUBVER/$rname/\$basearch/" |
20 |
|
+ $repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$rname/\$basearch/"); |
21 |
+ # delprop MirrorList |
+ # delprop MirrorList |
22 |
+ $repo->delete_prop('MirrorList'); |
+ $repo->delete_prop('MirrorList'); |
23 |
+ } |
+ } |
24 |
+} |
+} |
25 |
|
diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL |
26 |
|
--- smeserver-yum-2.4.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2020-12-03 16:40:55.145000000 -0500 |
27 |
|
+++ smeserver-yum-2.4.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2020-12-03 16:53:48.377000000 -0500 |
28 |
|
@@ -3,18 +3,25 @@ |
29 |
|
use File::Slurp; |
30 |
|
#get CentOS release we are |
31 |
|
my $SUBVER = read_file('/etc/centos-release'); |
32 |
|
- $SUBVER =~ s/^CentOS Linux release ([0-9\.]+).*?$/$1/; |
33 |
|
- return unless $1; |
34 |
|
+ $SUBVER =~ s/^CentOS (Linux )?release ([0-9\.]+).*?$/$2/; |
35 |
|
+ chomp $SUBVER; |
36 |
|
+ $SUBVER = $yum{eolversion} || $SUBVER || "6.10" ; |
37 |
|
+ return unless $SUBVER ne ""; |
38 |
|
my $curdate = strftime '%Y%m%d', localtime; |
39 |
|
# return unless EOL is reached |
40 |
|
return unless ( "$curdate" >= "20201130"); |
41 |
|
- for my $name ( qw(base updates centosplus extras fasttrack contrib) ) |
42 |
|
+ for my $name ( qw(base updates centosplus extras fasttrack contrib centos-sclo-rh centos-sclo-centos) ) |
43 |
|
{ |
44 |
|
my $repo = $DB->get($name) or next; |
45 |
|
my $rname = ( $name eq 'base' )? 'os' :$name; |
46 |
|
+ $rname = 'sclo' if $name eq "centos-sclo-rh" or $name eq "centos-sclo-centos"; |
47 |
|
+ my $sclo = ""; |
48 |
|
+ $sclo = "rh/" if $name eq "centos-sclo-rh"; |
49 |
|
+ $sclo = "sclo/" if $name eq "centos-sclo-centos"; |
50 |
|
# setprop BaseURL "http://vault.centos.org/$SUBVER/$rname/\$basearch/" |
51 |
|
- $repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$rname/\$basearch/"); |
52 |
|
+ $repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$rname/\$basearch/$sclo"); |
53 |
|
# delprop MirrorList |
54 |
|
- $repo->delete_prop('MirrorList'); |
55 |
|
+ #$repo->delete_prop('MirrorList'); |
56 |
|
+ $repo->set_prop('MirrorList', "disabled"); |
57 |
|
} |
58 |
|
} |
59 |
|
diff -Nur smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/yum.smerepos.d/sme-base.repo/20repositories smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/yum.smerepos.d/sme-base.repo/20repositories |
60 |
|
--- smeserver-yum-2.4.0.old/root/etc/e-smith/templates/etc/yum.smerepos.d/sme-base.repo/20repositories 2013-01-31 11:35:08.000000000 -0500 |
61 |
|
+++ smeserver-yum-2.4.0/root/etc/e-smith/templates/etc/yum.smerepos.d/sme-base.repo/20repositories 2020-12-03 16:53:38.184000000 -0500 |
62 |
|
@@ -13,14 +13,14 @@ |
63 |
|
$OUT .= "enabled=" . (($repos->prop('status') eq 'enabled') ? 1 : 0) |
64 |
|
. "\n"; |
65 |
|
|
66 |
|
- if ( exists $props{MirrorList} ) |
67 |
|
+ if ( ! exists $props{MirrorList} or $props{MirrorList} eq "disabled" ) |
68 |
|
+ { |
69 |
|
+ $OUT .= 'baseurl=' . $props{BaseURL} . "\n"; |
70 |
|
+ } |
71 |
|
+ else |
72 |
|
{ |
73 |
|
$OUT .= 'mirrorlist=' . $props{MirrorList} . "\n"; |
74 |
|
} |
75 |
|
- else |
76 |
|
- { |
77 |
|
- $OUT .= 'baseurl=' . $props{BaseURL} . "\n"; |
78 |
|
- } |
79 |
|
|
80 |
|
for my $prop (qw(Name)) |
81 |
|
{ |