/[smeserver]/rpms/e-smith-base/sme10/e-smith-base-5.8.0-bz11508-remove-templates-custom-ownedbyrpm.patch
ViewVC logotype

Contents of /rpms/e-smith-base/sme10/e-smith-base-5.8.0-bz11508-remove-templates-custom-ownedbyrpm.patch

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


Revision 1.1 - (show annotations) (download)
Tue Mar 30 22:29:35 2021 UTC (3 years, 7 months ago) by jpp
Branch: MAIN
CVS Tags: e-smith-base-5_8_0-99_el7_sme, e-smith-base-5_8_0-94_el7_sme, e-smith-base-5_8_0-98_el7_sme, e-smith-base-5_8_0-97_el7_sme, e-smith-base-5_8_0-96_el7_sme, e-smith-base-5_8_0-95_el7_sme, e-smith-base-5_8_0-93_el7_sme
* Tue Mar 30 2021 Jean-Philippe Pialasse <tests@pialasse.com> 5.8.0-93.sme
- merge dhcpdmanager custom template fragments with core [SME: 10657]
- remove templates-custom previously owned by a contrib [SME: 11508]
  they got migrated as part as normal backup restore

1 diff -Nur --no-dereference e-smith-base-5.8.0.old/createlinks e-smith-base-5.8.0/createlinks
2 --- e-smith-base-5.8.0.old/createlinks 2021-03-30 18:22:52.408000000 -0400
3 +++ e-smith-base-5.8.0/createlinks 2021-03-30 18:25:49.571000000 -0400
4 @@ -301,6 +301,7 @@
5 my $event = "e-smith-base-update";
6
7
8 +event_link("remove-templates-custom", $event, "02");
9 templates2events("/etc/smartd.conf", $event);
10 templates2events("/home/e-smith/ssl.pem/pem", $event);
11 templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
12 @@ -333,7 +334,7 @@
13 #--------------------------------------------------
14 my $event = "console-save";
15
16 -
17 +event_link("remove-templates-custom", $event, "02");
18 templates2events("/etc/smartd.conf", $event);
19 templates2events("/home/e-smith/ssl.pem/pem", $event);
20 event_link("set-hostname", $event, "10");
21 @@ -352,7 +353,7 @@
22 #--------------------------------------------------
23 $event = "bootstrap-console-save";
24
25 -
26 +event_link("remove-templates-custom", $event, "02");
27 templates2events("/etc/smartd.conf", $event);
28 templates2events("/home/e-smith/ssl.pem/pem", $event);
29 event_link("rmmod-bonding", $event, "10");
30 @@ -458,6 +459,7 @@
31
32 $event = "post-upgrade";
33
34 +event_link("remove-templates-custom", $event, "02");
35 templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event);
36 event_link("fix-startup", $event, "05");
37 event_link("rotate_timestamped_logfiles", $event, "05");
38 @@ -489,6 +491,7 @@
39
40 $event = "remoteaccess-update";
41
42 +event_link("remove-templates-custom", $event, "02");
43 safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/dhcpd");
44 event_link("systemd-default", $event, "88");
45 event_link("systemd-reload", $event, "89");
46 diff -Nur --no-dereference e-smith-base-5.8.0.old/root/etc/e-smith/events/actions/remove-templates-custom e-smith-base-5.8.0/root/etc/e-smith/events/actions/remove-templates-custom
47 --- e-smith-base-5.8.0.old/root/etc/e-smith/events/actions/remove-templates-custom 1969-12-31 19:00:00.000000000 -0500
48 +++ e-smith-base-5.8.0/root/etc/e-smith/events/actions/remove-templates-custom 2021-03-30 18:23:05.843000000 -0400
49 @@ -0,0 +1,25 @@
50 +#!/usr/bin/perl
51 +use Digest::MD5 qw(md5 md5_hex md5_base64);
52 +use strict;
53 +use warnings;
54 +
55 +my %files = (
56 + '/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/20LoadModule80PHP' => 'f1754b2ea09ec195d816b3e6d4b044a5', #smeserver-php-scl
57 + '/etc/e-smith/templates-custom/etc/hosts.allow/sshd' => 'd08f437bc0b38e996341f564cf446828', #smeserver-denyhosts
58 + '/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/35SSL00Listen443' => 'a3d1cf339126da076c1dcc2b21602bc9', #smeserver-softethervpn-server
59 + '/etc/e-smith/templates-custom/etc/dhcpd.conf/25DomainNameServers' => 'c201caf9528713b55708173a3ef26f18', #smeserver-dhcpmanager
60 + '/etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeDefault' => 'ad4468c7b2ad8f275514e7ce61747651', #smeserver-dhcpmanager
61 + '/etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeMax' => 'a450dbc91dc0d6443b29069d829c0a51', #smeserver-dhcpmanager
62 + '/etc/e-smith/templates-custom/etc/dhcpd.conf/25Routers' => 'd14a9b0153af3b7c608bb59eaccc24fc' #smeserver-dhcpmanager
63 +
64 +);
65 +
66 +for my $filename (keys %files) {
67 + next unless ( -f $filename);
68 + open (my $fh, '<', $filename) or die "Can't open '$filename': $!";
69 + binmode ($fh);
70 + my $sum =Digest::MD5->new->addfile($fh)->hexdigest;
71 + next unless $files{$filename} eq $sum;
72 + warn "md5sum matches, deleting fragment $filename identified as owned by a previous rpm\n";
73 + unlink $filename or warn "failed to remove $filename\n";
74 +}

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