From 91ca26de2730e42e00f202597245b64bab2abc4c Mon Sep 17 00:00:00 2001 From: Brian Read Date: Wed, 21 Aug 2024 12:39:46 +0100 Subject: [PATCH] Migrate panel for software installer from yum to dnf --- clog | 2 - .../smanager/lib/SrvMngr/Controller/Yum.pm | 38 +++++++++---------- smeserver-manager.spec | 7 +++- 3 files changed, 24 insertions(+), 23 deletions(-) delete mode 100644 clog diff --git a/clog b/clog deleted file mode 100644 index 489155d..0000000 --- a/clog +++ /dev/null @@ -1,2 +0,0 @@ -* Sun Jul 28 2024 Brian Read 11.0.0-14.sme -- fix [SME: ] diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm index 1699408..4daac79 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Yum.pm @@ -29,8 +29,8 @@ our %dbs; for ( qw(available installed updates) ) { - $dbs{$_} = esmith::ConfigDB->open_ro("yum_$_") or - die "Couldn't open yum_$_ DB\n"; + $dbs{$_} = esmith::ConfigDB->open_ro("dnf_$_") or + die "Couldn't open dnf_$_ DB\n"; } for ( qw(repositories) ) @@ -55,7 +55,7 @@ sub main { if ( -e "/var/run/yum.pid" ) { $yum_datas{'trt'} = 'LOGF'; $dest = 'yumlogfile'; - } elsif ($cdb->get_prop('yum', 'LogFile')) { + } elsif ($cdb->get_prop('dnf', 'LogFile')) { $yum_datas{'trt'} = 'PSTU'; $yum_datas{'reconf'} = $cdb->get_value('UnsavedChanges', 'yes'); $dest = 'yumpostupg'; @@ -85,7 +85,7 @@ sub do_display { # force $trt if current logfile if ( -e "/var/run/yum.pid" ) { $trt = 'LOGF'; - } elsif ($cdb->get_prop('yum', 'LogFile')) { + } elsif ($cdb->get_prop('dnf', 'LogFile')) { $trt = 'PSTU'; } @@ -112,7 +112,7 @@ sub do_display { } if ( $trt eq 'PSTU') { - if ($cdb->get_prop('yum', 'LogFile')) { + if ($cdb->get_prop('dnf', 'LogFile')) { $dest = 'yumpostupg'; $yum_datas{'reconf'} = $cdb->get_value('UnsavedChanges', 'yes'); } @@ -289,7 +289,7 @@ sub package_functions_enabled { my ($c) = @_; - return ($cdb->get_prop("yum", "PackageFunctions") eq "enabled"); + return ($cdb->get_prop("dnf", "PackageFunctions") eq "enabled"); } @@ -298,7 +298,7 @@ sub get_status { my ($c, $prop, $localise) = @_; - my $status = $cdb->get_prop("yum", $prop) || 'disabled'; + my $status = $cdb->get_prop("dnf", $prop) || 'disabled'; return $status unless $localise; @@ -433,7 +433,7 @@ sub change_settings { PackageFunctions ) ) { - $cdb->set_prop('yum', $param, $c->param("yum_$param")); + $cdb->set_prop("dnf", $param, $c->param("yum_$param")); } my $check4updates = $c->param("yum_check4updates"); @@ -441,21 +441,21 @@ sub change_settings { if ($check4updates ne 'disabled') { $status = 'enabled'; } - $cdb->set_prop('yum', 'check4updates', $check4updates); + $cdb->set_prop("dnf", 'check4updates', $check4updates); my $deltarpm = $c->param("yum_DeltaRpmProcess"); - $cdb->set_prop('yum', 'DeltaRpmProcess', $deltarpm); + $cdb->set_prop("dnf", 'DeltaRpmProcess', $deltarpm); my $downloadonly = $c->param("yum_DownloadOnly"); if ($downloadonly ne 'disabled') { $status = 'enabled'; } - $cdb->set_prop('yum', 'DownloadOnly', $downloadonly); + $cdb->set_prop("dnf", 'DownloadOnly', $downloadonly); my $AutoInstallUpdates = $c->param("yum_AutoInstallUpdates"); if ($AutoInstallUpdates ne 'disabled') { $status = 'enabled'; } - $cdb->set_prop('yum', 'AutoInstallUpdates', $AutoInstallUpdates); - $cdb->set_prop('yum', 'status', $status); + $cdb->set_prop("dnf", 'AutoInstallUpdates', $AutoInstallUpdates); + $cdb->set_prop("dnf", 'status', $status); my %selected = map {$_ => 1} @{$c->every_param('SelectedRepositories')}; @@ -469,7 +469,7 @@ sub change_settings { $dbs{repositories}->reload; - unless ( system( "/sbin/e-smith/signal-event", "yum-modify" ) == 0 ) + unless ( system( "/sbin/e-smith/signal-event", "dnf-modify" ) == 0 ) { return $c->l('yum_ERROR_UPDATING_CONFIGURATION'); } @@ -484,11 +484,11 @@ sub do_yum { for ( qw(SelectedGroups SelectedPackages) ) { - $cdb->set_prop("yum", $_, join(',', (@{$c->every_param($_)} ))); + $cdb->set_prop("dnf", $_, join(',', (@{$c->every_param($_)} ))); } esmith::util::backgroundCommand(0, - "/sbin/e-smith/signal-event", "yum-$function"); + "/sbin/e-smith/signal-event", "DNF-$function"); for ( qw(available installed updates) ) { $dbs{$_}->reload; @@ -517,7 +517,7 @@ sub format_yum_log { $cdb->reload; - my $filepage = $cdb->get_prop('yum', 'LogFile'); + my $filepage = $cdb->get_prop('dnf', 'LogFile'); return '' unless $filepage and ( -e "$filepage" ); my $out = sprintf "
";
@@ -537,7 +537,7 @@ sub post_upgrade_reboot {
 
     my $c = shift;
 
-    $cdb->get_prop_and_delete('yum', 'LogFile');
+    $cdb->get_prop_and_delete('dnf', 'LogFile');
     $cdb->reload;
 
     if (fork == 0) {
@@ -552,7 +552,7 @@ sub post_upgrade_reboot {
 sub show_yum_log {
     my $c = shift;
     my $out = $c->format_yum_log();
-    my $yum_log = $cdb->get_prop_and_delete('yum', 'LogFile');
+    my $yum_log = $cdb->get_prop_and_delete('dnf', 'LogFile');
     return $out;
 }
 
diff --git a/smeserver-manager.spec b/smeserver-manager.spec
index 216d2db..11082f0 100644
--- a/smeserver-manager.spec
+++ b/smeserver-manager.spec
@@ -2,7 +2,7 @@ Summary: Sme server  navigation module : manager 2
 %define name smeserver-manager
 Name: %{name}
 %define version 11.0.0
-%define release 14
+%define release 15
 Version: %{version}
 Release: %{release}%{?dist}
 License: GPL
@@ -108,8 +108,11 @@ true
 %defattr(-,root,root)
 
 %changelog
+* Wed Aug 21 2024 Brian Read  11.0.0-15.sme
+- Migrate SM2 Software installer panel from use of yum to dnf [SME: 12718]
+
 * Sun Jul 28 2024 Brian Read  11.0.0-14.sme
-- fix [SME: ]
+- Version skipped due to operator error! [SME:  ]
 
 * Sun Jul 28 2024 Brian Read  11.0.0-13.sme
 - Fix sysles.css template - overwrote it by mistake [SME: 12706]