Fix in linux

This commit is contained in:
Antonio de la Rosa 2024-02-06 20:55:20 +01:00
parent faf902432a
commit b774b3b0a9
2 changed files with 8 additions and 8 deletions

View file

@ -30,15 +30,15 @@ def install_package(package):
if distro_id=='debian' or distro_id=='ubuntu':
return shell_command('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y {}'.format(package[distro]))
return shell_command('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y {}'.format(package[distro_id]))
elif distro_id=='fedora' or distro_id=='almalinux' or distro_id=='rocky':
return shell_command('sudo dnf install -y {}'.format(package[distro]))
return shell_command('sudo dnf install -y {}'.format(package[distro_id]))
elif distro_id=='arch':
return shell_command('sudo pacman -S --noconfirm {}'.format(package[distro]))
return shell_command('sudo pacman -S --noconfirm {}'.format(package[distro_id]))
def patch_file(original_file, patch_file):
@ -49,7 +49,7 @@ def patch_file(original_file, patch_file):
return False
return shell_command("sudo patch {} < {}".format(original_file[distro], patch_file[distro]))
return shell_command("sudo patch {} < {}".format(original_file[distro_id], patch_file[distro_id]))
def systemd_service(action, service):
@ -60,7 +60,7 @@ def systemd_service(action, service):
return False
return shell_command('sudo systemctl {} {}'.format(action, service[distro]))
return shell_command('sudo systemctl {} {}'.format(action, service[distro_id]))
def exec(command):
@ -71,7 +71,7 @@ def exec(command):
return False
return shell_command(command[distro])
return shell_command(command[distro_id])
def sed(arr_sed):
@ -82,7 +82,7 @@ def sed(arr_sed):
return False
return shell_command("sudo sed -i s/{}/{}/g".format(arr_sed[distro][0], arr_sed[distro][1]))
return shell_command("sudo sed -i s/{}/{}/g".format(arr_sed[distro_id][0], arr_sed[distro_id][1]))
def json_log(message, error=0, status=0, progress=0, no_progress=0, return_message=0):

View file

@ -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.7.0',
version='0.7.1',
description='Utils for make *nix scripts.',
long_description='Utils for make *nix scripts.',
author='Antonio de la Rosa Caballero',