From 1d5b044276c6ba2d3b2522ff3bf870a8e91cd8e6 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Tue, 24 Jun 2025 11:10:37 +0200 Subject: [PATCH] shell: Do not abort if classpath env file is missing This is to be expected, and we have fallbacks. --- tools/helpers/lxc.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/helpers/lxc.py b/tools/helpers/lxc.py index 3bc2344..b8c0485 100644 --- a/tools/helpers/lxc.py +++ b/tools/helpers/lxc.py @@ -434,10 +434,15 @@ def android_env_attach_options(args): command = ["lxc-attach", "-P", tools.config.defaults["lxc"], "-n", "waydroid", "--clear-env", "--", "/system/bin/cat" ,"/data/system/environ/classpath"] - classpath = tools.helpers.run.user(args, command, output_return=True).strip() - for line in classpath.splitlines(): - _, k, v = line.split(' ', 2) - local_env[k] = v + try: + p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) + out, _ = p.communicate() + if p.returncode == 0: + for line in out.decode().splitlines(): + _, k, v = line.split(' ', 2) + local_env[k] = v + except: + pass env = [k + "=" + v for k, v in local_env.items()] return [x for var in env for x in ("--set-var", var)] -- 2.47.3