summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-09-18 11:46:46 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-09-18 11:46:46 +0100
commitfe42b7d6d41eeffd64f3963802c248cc59deedb2 (patch)
tree479abf8fe3861d983e24c896bc2648d56b8ade22
parent07199e3b0545f27ed0701c20748f082fb145f2a4 (diff)
bugfix : don't get stuck in progress mode if a package cannot be removed for some reason
-rw-r--r--src/backend/pkgremove.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/backend/pkgremove.py b/src/backend/pkgremove.py
index b039f96..552d802 100644
--- a/src/backend/pkgremove.py
+++ b/src/backend/pkgremove.py
@@ -9,6 +9,7 @@ import signal
import selectors
import subprocess
import sys
+import time
import sisyphus.checkenv
import sisyphus.getclr
import sisyphus.getfs
@@ -110,6 +111,11 @@ def start(pkgname, depclean=False, gfx_ui=False, unmerge=False):
p_exe.wait()
print(
"\nUnable to proceed! There are other packages with dependencies that prevent removal.")
+ for i in range(9, 0, -1):
+ print(f"Killing application in : {i} seconds!")
+ time.sleep(1)
+
+ os.kill(os.getpid(), signal.SIGTERM) # kill GUI window
else:
p_exe = subprocess.Popen(
['emerge'] + args + ['--pretend', '--verbose'] + list(pkgname))
@@ -140,10 +146,20 @@ def start(pkgname, depclean=False, gfx_ui=False, unmerge=False):
p_exe.wait()
print(f"{sisyphus.getclr.bright_red}\nUnable to proceed! Other packages have dependencies preventing removal.{sisyphus.getclr.reset}")
print(f"{sisyphus.getclr.bright_white}Use the {sisyphus.getclr.reset}{sisyphus.getclr.green}'--force'{sisyphus.getclr.reset}{sisyphus.getclr.bright_white} option to override at your own risk!{sisyphus.getclr.reset}\n")
+ sys.exit()
else:
if is_installed == 0:
- print(f"{sisyphus.getclr.bright_red}\nUnable to proceed! One or more selected packages could not be located for removal.\n{sisyphus.getclr.reset}")
- sys.exit()
+ if gfx_ui:
+ print(
+ "\nUnable to proceed! One or more selected packages could not be located for removal.")
+ for i in range(9, 0, -1):
+ print(f"Killing application in : {i} seconds!")
+ time.sleep(1)
+
+ os.kill(os.getpid(), signal.SIGTERM) # kill GUI window
+ else:
+ print(f"{sisyphus.getclr.bright_red}\nUnable to proceed! One or more selected packages could not be located for removal.\n{sisyphus.getclr.reset}")
+ sys.exit()
else:
if unmerge:
print(f"\n{sisyphus.getclr.bright_white}Selected packages are slated for{sisyphus.getclr.reset} {sisyphus.getclr.green}'forced'{sisyphus.getclr.reset} {sisyphus.getclr.bright_white}removal.{sisyphus.getclr.reset}\n")