/[smeserver]/rpms/smeserver-yum/sme9/smeserver-yum-2.4.0.bz10250.CentOSVault.onEOL.patch
ViewVC logotype

Contents of /rpms/smeserver-yum/sme9/smeserver-yum-2.4.0.bz10250.CentOSVault.onEOL.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Thu Dec 3 22:01:15 2020 UTC (3 years, 10 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-yum-2_4_0-30_el6_sme, HEAD
Changes since 1.5: +57 -0 lines
* Thu Dec 03 2020 Jean-Philipe Pialasse <tests@pialasse.com> 2.4.0-30.sme
- fix EOL patch to switch to vault [SME: 10250]
  fix string capture
  add default to 6.10 in case of failure
  add option to set it yourself via eolversion property of yum in config
  fix Mirrorlist preventing the BaseURL setting

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
2 --- 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
4 @@ -0,0 +1,20 @@
5 +{
6 + use POSIX qw(strftime);
7 + use File::Slurp;
8 + #get CentOS release we are
9 + my $SUBVER = read_file('/etc/centos-release');
10 + $SUBVER =~ s/^CentOS Linux release ([0-9\.]+).*?$/$1/;
11 + return unless $1;
12 + my $curdate = strftime '%Y%m%d', localtime;
13 + # return unless EOL is reached
14 + return unless ( "$curdate" >= "20201130");
15 + for my $name ( qw(base updates centosplus extras fasttrack contrib) )
16 + {
17 + my $repo = $DB->get($name) or next;
18 + my $rname = ( $name eq 'base' )? 'os' :$name;
19 + # setprop BaseURL "http://vault.centos.org/$SUBVER/$rname/\$basearch/"
20 + $repo->set_prop('BaseURL', "http://vault.centos.org/$SUBVER/$rname/\$basearch/");
21 + # delprop MirrorList
22 + $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 {

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed