guix/gnu/packages/patches/xpra-6.4-systemd-run.patch
Andy Tai 8455dba243 gnu: xpra: Update to 6.4.1.
* gnu/packages/xorg.scm (xpra): Update to 6.4.1.
[source](origin): Update patch file name.
* gnu/packages/patches/xpra-6.0-systemd-run.patch: Delete.
* gnu/packages/patches/xpra-6.4-systemd-run.patch: New file.
* gnu/packages/patches/xpra-6.1-install_libs.patch: Delete.
* gnu/packages/patches/xpra-6.4-install_libs.patch: New file.
* gnu/local.mk: Unregister deleted file and register new file.

Change-Id: Ib026b49114f5afca39ee8ec1a8a209cd6c11c7d6
2026-01-23 14:02:24 -08:00

45 lines
1.4 KiB
Diff

Distriction specific patch, not going upstream
Disable systemd-run if the command is not found.
diff --git a/xpra/scripts/main.py b/xpra/scripts/main.py
index 734e488eb9..36410d2d85 100755
--- a/xpra/scripts/main.py
+++ b/xpra/scripts/main.py
@@ -437,20 +437,26 @@ def use_systemd_run(s) -> bool:
cmd = ["systemd-run", "--quiet"]
if getuid() != 0:
cmd += ["--user"]
- cmd += ["--scope", "--", "true"]
- proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False)
try:
- proc.communicate(timeout=2)
- r = proc.returncode
- except TimeoutExpired: # pragma: no cover
- r = None
- if r is None:
- noerr(proc.terminate)
+ cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
+ proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False)
try:
- proc.communicate(timeout=1)
+ proc.communicate(timeout=2)
+ r = proc.returncode
except TimeoutExpired: # pragma: no cover
r = None
- return r == 0
+ if r is None:
+ try:
+ proc.terminate()
+ except Exception:
+ pass
+ try:
+ proc.communicate(timeout=1)
+ except TimeoutExpired: # pragma: no cover
+ r = None
+ return r==0
+ except FileNotFoundError:
+ return False
def verify_gir() -> None: