/[smeserver]/rpms/smeserver-yum/sme10/smeserver-yum-2.6.0-bz11477-migrateC6EOLrepo.patch
ViewVC logotype

Diff of /rpms/smeserver-yum/sme10/smeserver-yum-2.6.0-bz11477-migrateC6EOLrepo.patch

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

Revision 1.1 by jpp, Sun Mar 21 06:09:54 2021 UTC Revision 1.2 by jpp, Sun Mar 21 17:15:27 2021 UTC
# Line 1  Line 1 
1    diff -Nur --no-dereference smeserver-yum-2.6.0.old/root/etc/e-smith/db/configuration/migrate/Yum-remove-previous-eolversion smeserver-yum-2.6.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-previous-eolversion
2    --- smeserver-yum-2.6.0.old/root/etc/e-smith/db/configuration/migrate/Yum-remove-previous-eolversion    1969-12-31 19:00:00.000000000 -0500
3    +++ smeserver-yum-2.6.0/root/etc/e-smith/db/configuration/migrate/Yum-remove-previous-eolversion        2021-03-21 13:12:19.847000000 -0400
4    @@ -0,0 +1,9 @@
5    +{
6    +    use POSIX qw(strftime);
7    +    my $curdate = strftime '%Y%m%d', localtime;
8    +    my $curVers = 7;
9    +    my $curVersEOL = 20240630;
10    +    # we remove the forced value if for a previous release;
11    +    # also if not after the eol date
12    +    my $dropit = $DB->get_prop_and_delete('yum','eolversion') if ( (substr($yum{eolversion},0,1)<$curVers)  || ( "$curdate"  < "$curVersEOL") );
13    +}
14  diff -Nur --no-dereference 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  diff -Nur --no-dereference 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
15  --- smeserver-yum-2.6.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL    2021-03-21 02:05:05.155000000 -0400  --- smeserver-yum-2.6.0.old/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL    2021-03-21 02:05:05.155000000 -0400
16  +++ smeserver-yum-2.6.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL        2021-03-21 02:05:36.595000000 -0400  +++ smeserver-yum-2.6.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL        2021-03-21 13:12:20.078000000 -0400
17  @@ -1,6 +1,20 @@  @@ -1,15 +1,45 @@
18   {   {
19       use POSIX qw(strftime);       use POSIX qw(strftime);
20       use File::Slurp;       use File::Slurp;
21    +    my $curdate = strftime '%Y%m%d', localtime;
22    +    my $curVers = 7;
23    +    my $curVersEOL = 20240630;
24         #get CentOS release we are
25         my $SUBVER = read_file('/etc/centos-release');
26         $SUBVER =~ s/^CentOS Linux release ([0-9\.]+).*?$/$1/;
27         chomp $SUBVER;
28    +    # we ignore the force value if for a previous release; idealy should be deleted from another fragment against configuration db
29    +    delete $yum{eolversion} if ( ( defined $yum{eolversion} && (substr($yum{eolversion},0,1)<$curVers) ) || ( "$curdate"  < "$curVersEOL") );
30         $SUBVER =  $yum{eolversion} ||  $SUBVER ;
31  +  +
32  +    # we need to remove that from migrated server  +    # we need to remove that from migrated server
33  +    for my $name ( qw(base updates centosplus extras fasttrack centos-sclo-rh centos-sclo-centos) )  +    for my $name ( qw(base updates centosplus extras fasttrack centos-sclo-rh centos-sclo-centos) )
# Line 12  diff -Nur --no-dereference smeserver-yum Line 35  diff -Nur --no-dereference smeserver-yum
35  +       my $repo = $DB->get($name) or next;  +       my $repo = $DB->get($name) or next;
36  +       my $baseurl = $repo->prop('BaseURL') or next;  +       my $baseurl = $repo->prop('BaseURL') or next;
37  +       my $mirrorlist = $repo->prop('MirrorList') or next;  +       my $mirrorlist = $repo->prop('MirrorList') or next;
38  +       if ( $baseurl =~ /^http:\/\/vault\.centos\.org\/[5-6]/ )  +       if ( $baseurl =~ /^http:\/\/vault\.centos\.org\/([0-9])/ )
39    +       {
40    +           # we want to reset this unless vers 7
41    +           next if ($1 == $curVers && "$curdate"  >= "$curVersEOL");
42    +            $repo->delete_prop('MirrorList');
43    +            $repo->delete_prop('BaseURL');
44    +            unlink "/var/cache/yum/$name/$_" foreach qw(repomd.xml mirrorlist.txt);
45    +       }
46    +       else
47  +       {  +       {
48    +           # no match for a numerical, we probably want to reset that as well
49  +            $repo->delete_prop('MirrorList');  +            $repo->delete_prop('MirrorList');
50  +            $repo->delete_prop('BaseURL');  +            $repo->delete_prop('BaseURL');
51  +            unlink "/var/cache/yum/$name/$_" foreach qw(repomd.xml mirrorlist.txt);  +            unlink "/var/cache/yum/$name/$_" foreach qw(repomd.xml mirrorlist.txt);
52  +       }  +       }
53  +    }  +    }
54       #get CentOS release we are  +
55       my $SUBVER = read_file('/etc/centos-release');  +    # return unless we have a release version
56       $SUBVER =~ s/^CentOS Linux release ([0-9\.]+).*?$/$1/;       return unless $SUBVER ne "";
57         my $curdate = strftime '%Y%m%d', localtime;
58         # return unless EOL is reached
59    -    return unless ( "$curdate"  >= "20240630");
60    +    return unless ( "$curdate"  >= "$curVersEOL");
61         for my $name ( qw(base updates centosplus extras fasttrack centos-sclo-rh centos-sclo-centos) )
62         {
63             my $repo = $DB->get($name) or next;


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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