From 83a40a186440c7356f088b93d6439baed53bdd90 Mon Sep 17 00:00:00 2001 From: Javinator9889 Date: Thu, 10 May 2018 22:05:54 +0200 Subject: [PATCH] New version: 1.18.2 - corrected error while installing the new kernel --- .gitignore | 4 ++++ README.md | 2 +- README.rst | 2 +- kernel_upgrader/data_manager/__init__.py | 17 ++++++++++------- kernel_upgrader/values/Constants.py | 5 +++-- version.json | Bin 34 -> 34 bytes 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 7bbc71c..87e5080 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,7 @@ ENV/ # mypy .mypy_cache/ + +# Custom +old_logging.txt +Singleton.txt diff --git a/README.md b/README.md index 7fc40e2..13bd2c9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Python tool for upgrade your kernel safely from https://kernel.org -[![PyPi](https://img.shields.io/badge/v1.18.1%20-PyPi-green.svg)](https://pypi.org/project/KernelUpgrader/) +[![PyPi](https://img.shields.io/badge/v1.18.2%20-PyPi-green.svg)](https://pypi.org/project/KernelUpgrader/) [![ZIP](https://img.shields.io/badge/Package%20-Zip-green.svg)](https://github.com/Javinator9889/KernelUpgrader/archive/master.zip) [![GIT](https://img.shields.io/badge/Package%20-Git-green.svg)](https://github.com/Javinator9889/KernelUpgrader.git) diff --git a/README.rst b/README.rst index af361de..f47f50e 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ KernelUpgrader A Python tool for upgrade your kernel safely from https://kernel.org -.. image :: https://img.shields.io/badge/v1.18.1%20-PyPi-green.svg +.. image :: https://img.shields.io/badge/v1.18.2%20-PyPi-green.svg :target: https://pypi.org/project/KernelUpgrader/ :alt: PyPi .. image :: https://img.shields.io/badge/Package%20-Zip-green.svg diff --git a/kernel_upgrader/data_manager/__init__.py b/kernel_upgrader/data_manager/__init__.py index b836766..d7a6b99 100644 --- a/kernel_upgrader/data_manager/__init__.py +++ b/kernel_upgrader/data_manager/__init__.py @@ -49,9 +49,9 @@ def __init__(self, kernel_folder, new_kernel_version, current_date): new_kernel_version, current_date, kernel_folder) - self.__decompressed_path = "{}/linux_{}_{}/".format(home_dir, - new_kernel_version, - current_date) + self.__decompressed_path = "{}/linux_{}_{}".format(home_dir, + new_kernel_version, + current_date) self.__log = logging.getLogger(LOG_KERNEL) self.__log.debug("Kernel path: \"" + self.__kernel_path + "\"") self.__log.debug("Decompressed kernel path: \"" + self.__decompressed_path + "\"") @@ -83,7 +83,6 @@ def copy_latest_config(self): self.__log.error( "An error occurred while copying latest kernel. Error output: " + terminal_process.stderr .decode("utf-8")) - # self.__log.finish() raise CopyConfigError(OutputColors.FAIL + "No configuration was found or an error occurred while " "copying latest kernel boot configuration. Error output: " + terminal_process.stderr.decode("utf-8") + OutputColors.ENDC) @@ -93,7 +92,6 @@ def copy_latest_config(self): return True else: self.__log.error("No boot configuration found for the current kernel version") - # self.__log.finish() raise CopyConfigError(OutputColors.FAIL + "No boot configuration was found for the current kernel version." " Searching a config for version \"" + kernel_version.rstrip() + "\" for these files in \"/boot/\" partition\n" + str(files_found) + OutputColors.ENDC) @@ -154,11 +152,16 @@ def compileKernel(self): + OutputColors.ENDC) def installKernel(self): - from kernel_upgrader.values.Constants import COMPILE_INSTALL_NEW_KERNEL + from glob import glob + from kernel_upgrader.values.Constants import COMPILE_INSTALL_NEW_KERNEL, COMPILE_DEB_PKG returnToHomeDir() self.__log.debug("Starting kernel installation | Kernel source installation path: " + self.__decompressed_path) - process = subprocess.run(COMPILE_INSTALL_NEW_KERNEL.split(), stderr=subprocess.PIPE, stdout=subprocess.PIPE, + self.__log.info("Using \"glob\" for applying special chars to command") + deb_pkg_glob = glob(COMPILE_DEB_PKG) + process = subprocess.run(COMPILE_INSTALL_NEW_KERNEL.split() + deb_pkg_glob, + stderr=subprocess.PIPE, + stdout=subprocess.PIPE, cwd=self.__decompressed_path) if process.returncode != 0: self.__log.error("There was an error while installing kernel. Error: " + process.stderr.decode("utf-8")) diff --git a/kernel_upgrader/values/Constants.py b/kernel_upgrader/values/Constants.py index ef9aa47..d343a44 100644 --- a/kernel_upgrader/values/Constants.py +++ b/kernel_upgrader/values/Constants.py @@ -33,11 +33,12 @@ COMPILE_ADAPT_OLD_CONFIG = "make olddefconfig" COMPILE_RPM_OR_DEB = "/usr/bin/rpm -q -f /usr/bin/dpkg" COMPILE_COMPILE_NEW_KERNEL = "make -j{} deb-pkg" -COMPILE_INSTALL_NEW_KERNEL = "dpkg -i linux-*.deb" +COMPILE_INSTALL_NEW_KERNEL = "dpkg -i" +COMPILE_DEB_PKG = "linux-*.deb" # Other params OP_REPO_URL = "https://goo.gl/ZJ4zP9" -OP_VERSION = "1.18.1" +OP_VERSION = "1.18.2" OP_VERSION_RAW = "https://github.com/Javinator9889/KernelUpgrader/raw/master/version.json" # Program extended usage diff --git a/version.json b/version.json index ebddab0d605220254a60f6a55bef87b48220246b..1e56ba25e4ba800fe62042b248ef4dd8c71e3c1a 100644 GIT binary patch delta 9 QcmY#VnjptwG^JP%01BG|UH||9 delta 9 QcmY#VnjptwIHgz*01B4^T>t<8