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

Annotation 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


Revision 1.3 - (hide annotations) (download)
Mon Jul 11 15:20:21 2022 UTC (2 years, 3 months ago) by jpp
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
FILE REMOVED
bump version

1 jpp 1.2 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 jpp 1.1 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
16 jpp 1.2 +++ smeserver-yum-2.6.0/root/etc/e-smith/db/yum_repositories/migrate/45CentOSEOL 2021-03-21 13:12:20.078000000 -0400
17     @@ -1,15 +1,45 @@
18 jpp 1.1 {
19     use POSIX qw(strftime);
20     use File::Slurp;
21 jpp 1.2 + 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 jpp 1.1 +
32     + # we need to remove that from migrated server
33     + for my $name ( qw(base updates centosplus extras fasttrack centos-sclo-rh centos-sclo-centos) )
34     + {
35     + my $repo = $DB->get($name) or next;
36     + my $baseurl = $repo->prop('BaseURL') or next;
37     + my $mirrorlist = $repo->prop('MirrorList') or next;
38 jpp 1.2 + 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 jpp 1.1 + {
48 jpp 1.2 + # no match for a numerical, we probably want to reset that as well
49 jpp 1.1 + $repo->delete_prop('MirrorList');
50     + $repo->delete_prop('BaseURL');
51     + unlink "/var/cache/yum/$name/$_" foreach qw(repomd.xml mirrorlist.txt);
52     + }
53     + }
54 jpp 1.2 +
55     + # return unless we have a release version
56     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;

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