Skip to content

Commit

Permalink
Solved an error so the app was not able to delete old data - v1.18.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Javinator9889 committed May 21, 2018
1 parent 45374e3 commit 04b6b68
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -2,7 +2,7 @@
A Python tool for upgrade your kernel safely from https://kernel.org


[![PyPi](https://img.shields.io/badge/v1.18.4%20-PyPi-green.svg)](https://pypi.org/project/KernelUpgrader/)
[![PyPi](https://img.shields.io/badge/v1.18.5%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)

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -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.4%20-PyPi-green.svg
.. image :: https://img.shields.io/badge/v1.18.5%20-PyPi-green.svg
:target: https://pypi.org/project/KernelUpgrader/
:alt: PyPi
.. image :: https://img.shields.io/badge/Package%20-Zip-green.svg
Expand Down
3 changes: 2 additions & 1 deletion kernel_upgrader/__init__.py
Expand Up @@ -123,7 +123,8 @@ def application(arg):
__log.debug("Finished kernel decompression")
time.sleep(1)
__log.debug("Starting kernel compilation...")
print(Colors.OKBLUE + "Copying old configuration..." + Colors.ENDC)
__log.debug("Cleaning up space of old kernels")
print(Colors.OKBLUE + "Copying old configuration & cleaning up space..." + Colors.ENDC)
compiler = Compiler(kernel_folder, new_version, current_date)
__log.debug("Copying old kernel boot config")
if compiler.copy_latest_config():
Expand Down
6 changes: 5 additions & 1 deletion kernel_upgrader/data_manager/__init__.py
Expand Up @@ -58,7 +58,11 @@ def __init__(self, kernel_folder, new_kernel_version, current_date):
self.__log.debug(
"Removing old kernels in order to have enough space available on /root. We will only keep actually"
" installed version and the new one")
removeOldKernels()
are_kernels_deleted, stdout, stderr = removeOldKernels()
if not are_kernels_deleted:
self.__log.warning("Old data was not deleted or does not exists - more info: " + stderr)
else:
self.__log.warning("Old data successfully removed - more info: " + stdout)

def copy_latest_config(self):
from fnmatch import fnmatch
Expand Down
5 changes: 4 additions & 1 deletion kernel_upgrader/utils/__init__.py
Expand Up @@ -51,7 +51,10 @@ def removeOldKernels():
import subprocess
from kernel_upgrader.values.Constants import C_CLEAN_KERNELS

subprocess.run(C_CLEAN_KERNELS.split(), stderr=subprocess.PIPE, stdout=subprocess.PIPE)
clean_process = subprocess.run(C_CLEAN_KERNELS, shell=True, executable="/bin/bash",
stderr=subprocess.PIPE,
stdout=subprocess.PIPE)
return clean_process.returncode == 0, clean_process.stdout.decode("utf-8"), clean_process.stderr.decode("utf-8")


def cleanupOldLogs():
Expand Down
2 changes: 1 addition & 1 deletion kernel_upgrader/values/Constants.py
Expand Up @@ -37,7 +37,7 @@

# Other params
OP_REPO_URL = "https://goo.gl/ZJ4zP9"
OP_VERSION = "1.18.4"
OP_VERSION = "1.18.5"
OP_VERSION_RAW = "https://github.com/Javinator9889/KernelUpgrader/raw/master/version.json"

# Program extended usage
Expand Down
Binary file modified version.json
Binary file not shown.

0 comments on commit 04b6b68

Please sign in to comment.