diff --git a/ChangeLog.txt b/ChangeLog.txt index 84d798a4..2928c28b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -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: diff --git a/slpkg/main.py b/slpkg/main.py index a4756a2e..deeb13b0 100644 --- a/slpkg/main.py +++ b/slpkg/main.py @@ -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)