Added for kernel message

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2024-10-18 18:43:03 +03:00
parent 16668c9354
commit 7e3cbc36a1
2 changed files with 22 additions and 1 deletions

View file

@ -1,5 +1,9 @@
## slpkg - ChangeLog
### 5.1.6 - 18/10/2024
- Added:
* Warning message for kernel upgrade
### 5.1.5 - 06/10/2024
- Updated:

View file

@ -446,7 +446,7 @@ class Menu(Configs): # pylint: disable=[R0902]
raise SystemExit(0)
self.usage.help_short(1)
def upgrade(self) -> None:
def upgrade(self) -> None: # pylint: disable=[R0912]
"""Upgrade the installed packages.
Raises:
@ -456,6 +456,7 @@ class Menu(Configs): # pylint: disable=[R0902]
removed: list = []
added: list = []
ordered: bool = True
kernel_generic_current: str = self.utils.is_package_installed('kernel-generic')
if len(self.args) == 1:
@ -505,9 +506,19 @@ class Menu(Configs): # pylint: disable=[R0902]
else:
self.usage.help_minimal(f"{self.prog_name}: invalid repository '{self.repository}'")
kernel_generic_new: str = self.utils.is_package_installed('kernel-generic')
if kernel_generic_current != kernel_generic_new:
self._kernel_image_message()
raise SystemExit(0)
self.usage.help_short(1)
def _kernel_image_message(self) -> None:
print(f"\n{self.bred}Warning!{self.endc} Your kernel image looks like to have been upgraded!\n"
"Please update the bootloader with the new parameters of the upgraded kernel.\n"
"See: lilo, eliloconfig or grub-mkconfig -o /boot/grub/grub.cfg,\n"
"depending on how you have your system configured.\n")
def repo_info(self) -> None:
"""Print repositories information.
@ -556,6 +567,7 @@ class Menu(Configs): # pylint: disable=[R0902]
SystemExit: Exit code 0.
"""
command: str = Menu.install.__name__
kernel_generic_current: str = self.utils.is_package_installed('kernel-generic')
if len(self.args) >= 2:
self.data: dict = self.load_data.load(self.repository)
@ -573,6 +585,11 @@ class Menu(Configs): # pylint: disable=[R0902]
else:
install_sbo = Slackbuilds(self.repository, self.data, packages, self.flags, mode=command)
install_sbo.execute()
kernel_generic_new: str = self.utils.is_package_installed('kernel-generic')
if kernel_generic_current != kernel_generic_new:
self._kernel_image_message()
raise SystemExit(0)
self.usage.help_short(1)