diff --git a/pastafariutils/linux.py b/pastafariutils/linux.py index 31452e6..32570ef 100644 --- a/pastafariutils/linux.py +++ b/pastafariutils/linux.py @@ -45,13 +45,22 @@ def install_package(package): return shell_command('sudo pacman -S --noconfirm {}'.format(package[distro_id])) -def patch_file(original_file, patch_file): +def patch_file(original_file, patch_file, no_patch_distro=True): distro_id=check_distro(original_file) if not distro_id: - return False + if no_patch_distro: + + print('This distro ignored for patch') + + return True + else: + + print('This distro need a patch') + + return False if distro_id in original_file: @@ -60,7 +69,7 @@ def patch_file(original_file, patch_file): print('Ignored file for patching for distro '+distro_id) - return False + return True def systemd_service(action, service): @@ -79,7 +88,7 @@ def systemd_service(action, service): print('Cannot restart service') - return False + return True def exec(command): @@ -89,7 +98,7 @@ def exec(command): return False - if not distro_id in command: + if distro_id in command: return shell_command(command[distro_id]) @@ -97,7 +106,7 @@ def exec(command): print('Cannot execute the command in this distro') - return False + return True def sed(arr_sed): @@ -106,7 +115,7 @@ def sed(arr_sed): if not distro_id: - return False + return 0 return shell_command("sudo sed -i \"s/{}/{}/g\" {}".format(arr_sed[distro_id][0], arr_sed[distro_id][1], arr_sed[distro_id][2])) diff --git a/pyproject.toml b/pyproject.toml index bdaede1..d1b45e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi" name = "pastafariutils" authors = [{name = "Antonio de la Rosa", email = "antonio.delarosa@salirdelhoyo.com"}] readme = "README.md" -version = "0.76.4" +version = "0.76.5" description = "Utils for make *nix scripts." # dynamic = ["version", "description"] diff --git a/setup.py b/setup.py index d61b7b9..51ffa3e 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ if sys.version_info < (3, 9): raise NotImplementedError("Sorry, you need at least Python 3.9 for use pastafariutils.") setup(name='pastafariutils', - version='0.76.4', + version='0.76.5', description='Utils for make *nix scripts.', long_description='Utils for make *nix scripts.', author='Antonio de la Rosa Caballero',