]> glassweightruler.freedombox.rocks Git - waydroid.git/commitdiff
shell: Do not abort if classpath env file is missing
authorAlessandro Astone <ales.astone@gmail.com>
Tue, 24 Jun 2025 09:10:37 +0000 (11:10 +0200)
committerAlessandro Astone <ales.astone@gmail.com>
Tue, 24 Jun 2025 09:10:41 +0000 (11:10 +0200)
This is to be expected, and we have fallbacks.

tools/helpers/lxc.py

index 3bc2344ab00c8edab9bbeb359da04ac13198f04b..b8c0485b921c727a7ebf22192aeafa546f124dd5 100644 (file)
@@ -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"]
     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)]
 
     env = [k + "=" + v for k, v in local_env.items()]
     return [x for var in env for x in ("--set-var", var)]