From 9ed56fa654c9eba8b644308cebf002af504a2b09 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 8 Feb 2024 17:03:27 +0000 Subject: I love pickles --- src/backend/solverdeps.py | 6 +++++- src/backend/uninstall.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/backend') diff --git a/src/backend/solverdeps.py b/src/backend/solverdeps.py index b866cc8..97d19dd 100644 --- a/src/backend/solverdeps.py +++ b/src/backend/solverdeps.py @@ -1,9 +1,12 @@ #!/usr/bin/python3 import animation +import os +import pickle import signal import subprocess import sys +import sisyphus.getfs def sigint_handler(signal, frame): @@ -27,6 +30,8 @@ def start(pkgname=None): if any(key in p_out for key in ["pulled in by:", "required"]): is_needed = int(1) + pickle.dump(is_needed, open(os.path.join( + sisyphus.getfs.p_mtd_dir, "sisyphus_pkgrdeps.pickle"), "wb")) except KeyboardInterrupt: p_exe.terminate() try: @@ -34,4 +39,3 @@ def start(pkgname=None): except subprocess.TimeoutExpired: p_exe.kill() sys.exit() - return is_needed diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py index ede3947..3900f4b 100644 --- a/src/backend/uninstall.py +++ b/src/backend/uninstall.py @@ -2,11 +2,14 @@ import atexit import io +import os +import pickle import signal import subprocess import sys import sisyphus.checkenv import sisyphus.getcolor +import sisyphus.getfs import sisyphus.killemerge import sisyphus.solverdeps import sisyphus.syncdb @@ -28,9 +31,12 @@ def start(pkgname, depclean=False, gfx_ui=False, unmerge=False): sys.exit() else: if gfx_ui: - is_needed = sisyphus.solverdeps.start.__wrapped__(pkgname) + sisyphus.solverdeps.start.__wrapped__(pkgname) else: - is_needed = sisyphus.solverdeps.start(pkgname) + sisyphus.solverdeps.start(pkgname) + + is_needed = pickle.load( + open(os.path.join(sisyphus.getfs.p_mtd_dir, "sisyphus_pkgrdeps.pickle"), "rb")) if is_needed != 0: if gfx_ui: -- cgit v1.2.3