6 Commits

Author SHA1 Message Date
a6714d037b prepare 1.4.7 release 2025-02-28 07:55:51 +01:00
bbe23b1549 better kernel version sorting
should now detect that 6.12.16 is newer than 6.6.74 for example
2025-02-28 07:53:11 +01:00
17fc601022 print service and policy for rouge services 2024-12-20 14:20:07 +01:00
f1ded26b9f properly log processes which still has open files after restart 2024-12-17 01:28:12 +01:00
8d373f599c Fix eclass check for packages with many revisions 2024-10-23 17:03:30 +02:00
17ef7eee8e fix syntax 2024-08-30 09:20:48 +02:00
3 changed files with 9 additions and 5 deletions

View File

@ -119,6 +119,9 @@ def is_system_package(atom, eclasses):
log.debug(f"{name} is a sys-boot package")
return True
if eclasses is True:
return True
# libc-packages should be considered system-packages as they generally
# requires the system to be restarted. Not sure if there is a better way
# then just checking for specific packages here, but as far as I know there
@ -140,7 +143,7 @@ def is_system_package(atom, eclasses):
def get_eclasses(atom):
log = logging.getLogger(sau.LOGNAME)
eclasses = []
name=re.sub(r'^[<=>]*(.*?)(?:-\d)?(?:::\w+)?$', r'\1', atom)
name=re.sub(r'^[<=>]*(.*?)(?:-\d+)?(?:::\w+)?$', r'\1', atom)
test_re = re.compile(r'^\s*inherit\s+')
cmd=[ EQUERY_PATH, 'w', name ]
ret, out, err = sau.helpers.exec_cmd(cmd)
@ -312,7 +315,7 @@ def pkg_upgrade():
log.warning(line)
# rebuild rust
if any([x in rebuild_packages for x in ('dev-lang/rust', 'dev-lang/rust-bin'):
if any([x in rebuild_packages for x in ('dev-lang/rust', 'dev-lang/rust-bin')]):
log.info("Running rust-rebuild due to update of rust")
cmd = [
EMERGE_PATH,
@ -416,7 +419,8 @@ def pkg_upgrade():
for sysfile in ['config', 'initramfs', 'System.map', 'vmlinuz', 'kernel']:
match = sorted(
[f for f in files if f.startswith(f'{sysfile}-')],
reverse=True)
reverse=True,
key=lambda x: tuple(map(int, x.split('-')[1].split('.')[:3])))
for f in match[keep_kernels:]:
log.debug(f"Removing old kernel file {f}")
os.remove(os.path.join(root, f))

View File

@ -177,7 +177,7 @@ def restart_services():
if get_deleted_open_files(proc):
service = services[proc_name]
policy = _get_service_restart_policy(service)
_warn(policy, f'{proc} still has deleted files open')
log.warning(f'{proc} (service {service} with policy {policy}) still has deleted files open')
recommend_restart = True
return recommend_restart

View File

@ -5,7 +5,7 @@ from setuptools import setup, find_packages
setup(
name='sau',
version='1.4.4',
version='1.4.7',
description='Tool for auto-updating OS and packages',
author='Feffe',
author_email='feffe@fulh.ax',