6 Commits

Author SHA1 Message Date
6e69a3f6e6 * Tue Apr 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix debuglevel=-2 not allowed [SME: 12637]
- force modules needed for core [SME: 12618]
  php:remi-8.3 perl:5.26 python36:3.6 mariadb:10.5
2024-04-23 12:18:22 -04:00
4adf87588b * Thu Apr 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-10.sme
- fix RuntimeError: dictionary changed size during iteration [SME: 12633]
2024-04-18 14:59:05 -04:00
b3580a5bd4 * Wed Apr 17 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-9.sme
- fix RuntimeError: dictionary changed size during iteration [SME: 12633]
2024-04-17 11:42:12 -04:00
b467a955d1 * Tue Apr 16 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
- fix python error in dnf plugin [SME: 12631]
2024-04-16 16:00:24 -04:00
8303299ad7 * Mon Apr 08 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix python error in dnf plugin [SME: 12601]
- fix server error in old manager [SME: 12602]
2024-04-08 00:58:32 -04:00
cc7626c868 * Mon Apr 08 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix python error in dnf plugin [SME: 12601]
- fix server error in old manager [SME: 12602]
2024-04-08 00:56:32 -04:00
5 changed files with 55 additions and 26 deletions

View File

@@ -31,7 +31,9 @@ event_link("systemd-default", $event, "88");
templates2events("/etc/rsyslog.conf",$event);
safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyslog");
event_link("dnf_modules", 'post-install', "70");
#--------------------------------------------------
# functions for manager panel
#--------------------------------------------------
panel_link("dnf", "manager");
panel_link("yum", "manager");

View File

@@ -0,0 +1,14 @@
#!/usr/bin/python3
import dnf
base = dnf.Base()
base.read_all_repos()
base.fill_sack()
module_base = dnf.module.module_base.ModuleBase(base)
module_base.switch_to(['php:remi-8.3'])
module_base.switch_to(['perl:5.26'])
module_base.switch_to(['python36:3.6'])
module_base.switch_to(['mariadb:10.5'])
base.do_transaction()

View File

@@ -5,7 +5,7 @@
# -4: critical
# -3: critical+errors
# -2: critical+errors+warnings (default)
debuglevel = -{ $dnf{Debug} || '2' }
debuglevel = { $dnf{Debug} || '2' }
# Uncomment to auto-import new gpg keys (dangerous)
# assumeyes = True

View File

@@ -15,16 +15,9 @@ events_path = '/etc/e-smith/events'
initialize_database = events_path + '/actions/initialize-default-databases'
navigation_conf = events_path + '/actions/navigation-conf'
systemctl = "/usr/bin/systemctl"
# not used
#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/cache/dnf/dnf.status'
#not used
#expand_template = '/sbin/e-smith/expand-template'
#not used
#service = '/sbin/e-smith/service'
eventlist = dict()
actionlist = dict()
@@ -68,7 +61,7 @@ servicenames['squid']='squid',
servicenames['qmail']='qmail',
servicenames['qpsmtpd']='qpsmtpd', 'sqpsmtpd',
DEBUG = True
DEBUG = False
smechange = False
smechangelist = dict()
ourfile = False
@@ -87,7 +80,6 @@ class SMEServer(dnf.Plugin):
self.base = base
self.logger = logger
self.report_yum_status('init')
self.log("smeserver.py: __init__")
def log(self,s):
if DEBUG :
@@ -122,21 +114,28 @@ class SMEServer(dnf.Plugin):
def pre_config(self):
self.report_yum_status('pre_config')
self.log("smeserver.py: pre_config")
def config(self):
self.report_yum_status('config')
self.log("smeserver.py: config")
def sack(self):
global ourfile
ourfile = True
self.report_yum_status('sack')
self.log("smeserver.py: sack")
module_base = dnf.module.module_base.ModuleBase(self.base)
module_base.switch_to(['php:remi-8.3'])
module_base.switch_to(['perl:5.26'])
module_base.switch_to(['python36:3.6'])
module_base.switch_to(['mariadb:10.5'])
def resolved(self):
self.report_yum_status('resolved')
self.log("smeserver.py: resolved")
module_base = dnf.module.module_base.ModuleBase(self.base)
module_base.switch_to(['php:remi-8.3'])
module_base.switch_to(['perl:5.26'])
module_base.switch_to(['python36:3.6'])
module_base.switch_to(['mariadb:10.5'])
#2 PKG_DOWNGRADE = dnf.transaction.PKG_DOWNGRADE # :api
#1 PKG_INSTALL = dnf.transaction.PKG_INSTALL # :api
#4 PKG_OBSOLETE = dnf.transaction.PKG_OBSOLETE # :api
@@ -150,7 +149,6 @@ class SMEServer(dnf.Plugin):
def pre_transaction(self):
self.report_yum_status('pretrans')
self.log("smeserver.py: Pretrans")
# Prefetch filelist for packages to be removed,
in_ts_items = []
out_ts_items = []
@@ -207,7 +205,7 @@ class SMEServer(dnf.Plugin):
n= str(tsmem.name)
# if the pkg.name is present on both IN and OUT, then we assume update/downgrade and continue to transaction
if n in installs_dict :
self.log('updating ==> state ' + str(tsmem.pkg) + " to " + str(installs_dict[n].pkg) )
#self.log('updating ==> state ' + str(tsmem.pkg) + " to " + str(installs_dict[n].pkg) )
continue
self.log('**Package: ' + str(tsmem.pkg) + ' to be removed')
smeevent = n + '-update'
@@ -256,8 +254,8 @@ class SMEServer(dnf.Plugin):
# if we are here this is a smeserver pkg without an update event, needs reboot...
if (n.startswith('smeserver') or n.startswith('e-smith')) and not n.startswith('smeserver-locale'):
smechange = True
smechangelist[n]=str(tsmem.installed) + " " + str(tsmem.pkg)
self.log("smechange set to True because of " + n + " without an update event " + str(tsmem.installed) + " " + str(tsmem.pkg) )
smechangelist[n]=str(tsmem.pkg)
self.log("smechange set to True because of " + n + " without an update event " + str(tsmem.pkg) )
#end of if smeserver-*-update event exist
# do we need this for removal ?
if "/etc/e-smith/web/panels/manager/cgi-bin" in tsmem.files :
@@ -292,7 +290,6 @@ class SMEServer(dnf.Plugin):
def transaction(self):
self.report_yum_status('transaction')
self.log("smeserver.py: transaction")
#ts = self.getTsInfo()
#rpmdb = self.getRpmDB()
@@ -355,7 +352,7 @@ class SMEServer(dnf.Plugin):
# either no exception or does not fit exceptions: we need reboot
smechange = True
smechangelist[n]=str(n) + "-" + str(v) + "-" + str(r)
self.log("smechange set to True because of " + n + " with " + str(v) + "-" + str(r) + " " + str(tsmem.installed))
self.log("smechange set to True because of " + n + " with " + str(v) + "-" + str(r) )
#self.log("smechange set to True because of " + pkg)
# check if we're upgrading a restartpkgs rpm
@@ -417,8 +414,8 @@ class SMEServer(dnf.Plugin):
else:
if (n.startswith('smeserver') or n.startswith('e-smith')) and not n.startswith('smeserver-locale') and not (n in removenorebootok):
smechange = True
smechangelist[n]=str(tsmem.po.state) + " " + str(tsmem.current_state) + " " + str(tsmem.output_state)
self.log("smechange set to True because of " + n + " with " + str(tsmem.po.state) + " " + str(tsmem.current_state) + " " + str(tsmem.output_state) )
smechangelist[n]=str(tsmem.name) + "-" + str(tsmem.version) + "-" + str(tsmem.release)
self.log("smechange set to True because of " + n )
# as long as it is a sme pkg we need to rebuild panel
if "/etc/e-smith/web/panels/manager/cgi-bin" in tsmem.files :
@@ -450,7 +447,8 @@ class SMEServer(dnf.Plugin):
for act in ('navigation-conf','systemd-reload','systemd-default'):
global iter
iter = 0
for key in actionlist.keys():
tmpactionlist = actionlist
for key in list(tmpactionlist):
if key.endswith(act):
iter += 1
if iter>1:

View File

@@ -2,7 +2,7 @@
Summary: Koozali SME Server rpm updater
Name: %{name}
%define version 11.0.0
%define release 6
%define release 11
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@@ -68,7 +68,22 @@ mkdir -p root/etc/yum.smerepos.d
%changelog
* Wed Apr 04 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
* Tue Apr 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-11.sme
- fix debuglevel=-2 not allowed [SME: 12637]
- force modules needed for core [SME: 12618]
php:remi-8.3 perl:5.26 python36:3.6 mariadb:10.5
* Thu Apr 18 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-10.sme
- fix RuntimeError: dictionary changed size during iteration [SME: 12633]
* Tue Apr 16 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
- fix python error in dnf plugin [SME: 12631]
* Mon Apr 08 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix python error in dnf plugin [SME: 12601]
- fix server error in old manager [SME: 12602]
* Thu Apr 04 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-6.sme
- rewrite smeserver.py plugin [SME: 12113]
- fix migrate template 39VisibleSmeContribs, 45RockyEOL [SME: 12549]