diff --git a/debian/prerm b/debian/prerm index e0c5126..958c37e 100755 --- a/debian/prerm +++ b/debian/prerm @@ -13,6 +13,7 @@ def col(id): import subprocess import sys import os +from shutil import rmtree # Only run when we actually want to remove if "remove" not in sys.argv and "purge" not in sys.argv: @@ -24,21 +25,21 @@ if not os.path.exists("/lib/security/howdy/cli"): # Remove files and symlinks try: - subprocess.call(["rm /usr/local/bin/howdy"], shell=True) -except e: + os.unlink('/usr/local/bin/howdy') +except Exception: print("Can't remove executable") try: - subprocess.call(["rm /usr/share/bash-completion/completions/howdy"], shell=True) -except e: + os.unlink('/usr/share/bash-completion/completions/howdy') +except Exception: print("Can't remove autocompletion script") try: - subprocess.call(["rm -rf /lib/security/howdy"], shell=True) -except e: + rmtree('/lib/security/howdy') +except Exception: # This error is normal pass # Remove face_recognition and dlib -subprocess.call(["pip3 uninstall face_recognition face_recognition_models dlib -y --no-cache-dir"], shell=True) +subprocess.call(['pip3', 'uninstall', 'dlib', '-y', '--no-cache-dir']) # Print a tearbending message print(col(2) + """