From c158b051fd4fd6767c4d3d0a4e8ca981bdf40758 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Mon, 25 Mar 2024 22:42:14 -0400 Subject: [PATCH] * Mon Mar 25 2024 Jean-Philippe Pialasse 2.6.2-9.sme - initial release of smeserver-update based on smeserver-yum * tidy centos repos, add rocky repos, add support for metalinks, tidy most references to yum (except manager), tidy config and templates * yum-cron moved to dnf-automatic, * rename yum_** esmith db, except yum_repositories * moved yum.conf to dnf.conf with deltarpm , fastestmirror support * add requirement for dnf post-transaction-actions * adapt setting for priorities * renamed yum.service to dnf.service * TODO smeserver.py plugin --- .../db/configuration/migrate/smeserver-update | 5 ++++ .../etc/dnf/dnf.conf/10main_fastestmirror | 1 + root/usr/lib/yum-plugins/smeserver.py | 6 ++-- .../esmith/FormMagick/Panel/yum.pm | 2 +- smeserver-update.spec | 30 +++++++++---------- 5 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_fastestmirror diff --git a/root/etc/e-smith/db/configuration/migrate/smeserver-update b/root/etc/e-smith/db/configuration/migrate/smeserver-update index 94d1ae4..a0aff9c 100644 --- a/root/etc/e-smith/db/configuration/migrate/smeserver-update +++ b/root/etc/e-smith/db/configuration/migrate/smeserver-update @@ -23,6 +23,11 @@ if ($check4contribsupdates) { $DB->get('dnf')->delete_prop('check4contribsupdates'); } + my $output_width = $DB->get_prop('dnf','output_width'); + if ($output_width) { + $DB->get('dnf')->delete_prop('output_width'); + } + } diff --git a/root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_fastestmirror b/root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_fastestmirror new file mode 100644 index 0000000..ec308b8 --- /dev/null +++ b/root/etc/e-smith/templates/etc/dnf/dnf.conf/10main_fastestmirror @@ -0,0 +1 @@ +fastestmirror={( ( $dnf{fastestmirror} ||'enabled') eq "enabled")?1:0;} diff --git a/root/usr/lib/yum-plugins/smeserver.py b/root/usr/lib/yum-plugins/smeserver.py index 925ce70..5c4e581 100644 --- a/root/usr/lib/yum-plugins/smeserver.py +++ b/root/usr/lib/yum-plugins/smeserver.py @@ -21,7 +21,7 @@ dnf_update_dbs = events_path + '/actions/yum-update-dbs' Conflicts=yum-cron.service dnf-automatic-notifyonly.service dnf-automatic.service signal_event = '/sbin/e-smith/signal-event' config_set = '/sbin/e-smith/config' -status_file = '/var/run/yum.status' +status_file = '/var/cache/dnf/dnf.status' expand_template = '/sbin/e-smith/expand-template' service = '/sbin/e-smith/service' @@ -432,8 +432,8 @@ def posttrans_hook(conduit): os.spawnl(os.P_WAIT, systemctl, systemctl, 'restart', 'yum') def close_hook(conduit): - if ourfile and os.path.isfile('/var/run/yum.status'): - os.unlink('/var/run/yum.status') + if ourfile and os.path.isfile(status_file): + os.unlink(status_file) if smechange: print "\nThe following updates require a server reboot:\n" + str(smechangelist.keys()) diff --git a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm index 52d16f8..5ea807e 100644 --- a/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm +++ b/root/usr/share/perl5/vendor_perl/esmith/FormMagick/Panel/yum.pm @@ -286,7 +286,7 @@ sub print_yum_status_page my ($fm) = @_; my @yum_status; - if (open(YUM_STATUS, "; close(YUM_STATUS); } diff --git a/smeserver-update.spec b/smeserver-update.spec index 397bcad..12fdc6d 100644 --- a/smeserver-update.spec +++ b/smeserver-update.spec @@ -11,6 +11,8 @@ Source: %{name}-%{version}.tar.xz BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot BuildArchitectures: noarch +Provides: smeserver-yum-%{version}-%{release} +Obsoletes: smeserver-yum < %{version}-%{release} Requires: smeserver-formmagick Requires: smeserver-base Requires: perl(CGI::FormMagick) >= 0.91-26 @@ -49,13 +51,12 @@ mkdir -p root/etc/yum.smerepos.d (cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) /bin/rm -f %{name}-%{version}-filelist /sbin/e-smith/genfilelist \ - --file '/sbin/e-smith/yum_update_dbs' 'attr(0700,root,root)' \ - --file '/sbin/e-smith/yum' 'attr(0755,root,root)' \ + --file '/sbin/e-smith/dnf_update_dbs' 'attr(0700,root,root)' \ --file '/sbin/e-smith/check4updates' 'attr(0755,root,root)' \ --file '/sbin/e-smith/check4contribsupdates' 'attr(0755,root,root)' \ --file '/sbin/e-smith/yumdownloadonly' 'attr(0755,root,root)' \ - --file '/etc/cron.daily/smeserver-yum' 'attr(0700,root,root)' \ - --dir /var/log/yum 'attr(2750,root,root)' \ + --file '/etc/cron.daily/smeserver-update' 'attr(0700,root,root)' \ + --dir /var/log/dnf 'attr(2750,root,root)' \ $RPM_BUILD_ROOT > %{name}-%{version}-%{release}-filelist %clean @@ -71,18 +72,15 @@ mkdir -p root/etc/yum.smerepos.d %changelog * Mon Mar 25 2024 Jean-Philippe Pialasse 2.6.2-9.sme - initial release of smeserver-update based on smeserver-yum - updated requirements - TODO tidy centos repos - TODO add rocky repos - TODO tidy reference yo yum - TODO yum-cron alternative for updates list and auto update - TODO rename yum_** esmith db - TODO deltarpm tidy - TODO adapt setting for fastestmirror - TODO adapt settings for post-transaction-actions - TODO adapt setting for priorities - TODO adapt /etc/yum.conf -> /etc/dnf/dnf.conf - TODO rename yum.service ? + * tidy centos repos, add rocky repos, add support for metalinks, + tidy most references to yum (except manager), tidy config and templates + * yum-cron moved to dnf-automatic, + * rename yum_** esmith db, except yum_repositories + * moved yum.conf to dnf.conf with deltarpm , fastestmirror support + * add requirement for dnf post-transaction-actions + * adapt setting for priorities + * renamed yum.service to dnf.service + * TODO smeserver.py plugin * Fri Mar 15 2024 Jean-Philippe Pialasse 2.6.2-8.sme - disable brp-python-bytecompile [SME: 12511]