unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 1ea11830a5053b0f013420be57ce3bb9a9baedf1 1202 bytes (raw)
name: gnu/packages/patches/xpra-4.0.1-systemd-run.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 
Disable systemd-run if the command is not found.

diff -Naur xpra-4.0.1/xpra/scripts/main.py xpra-4.0.1.patched/xpra/scripts/main.py
--- xpra-4.0.1/xpra/scripts/main.py	2020-05-17 18:12:15.000000000 +0200
+++ xpra-4.0.1.patched/xpra/scripts/main.py	2020-06-01 12:12:18.500257507 +0200
@@ -312,16 +312,18 @@
     if not is_systemd_pid1():
         return False
     #test it:
-    cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
-    proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False)
-    r = pollwait(proc, timeout=1)
-    if r is None:
-        try:
-            proc.terminate()
-        except Exception:
-            pass
-    return r==0
-
+    try:
+        cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
+        proc = Popen(cmd, stdin=None, stdout=None, stderr=None, shell=False)
+        r = pollwait(proc, timeout=1)
+        if r is None:
+            try:
+                proc.terminate()
+            except Exception:
+                pass
+        return r==0
+    except FileNotFoundError:
+        return False
 
 def run_mode(script_file, error_cb, options, args, mode, defaults):
     #configure default logging handler:

debug log:

solving 1ea11830a5 ...
found 1ea11830a5 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).