unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 8dfd9c82f0c9d052e82277d44dd67214f4d732fe 1541 bytes (raw)
name: gnu/packages/patches/xpra-5.0-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
35
36
37
38
39
40
41
42
43
44
45
 
Disable systemd-run if the command is not found.

diff -ru xpra-4.2~/xpra/scripts/main.py xpra-4.2/xpra/scripts/main.py
--- xpra-4.2~/xpra/scripts/main.py	2021-06-06 08:51:13.756815842 -0700
+++ xpra-4.2/xpra/scripts/main.py	2021-06-06 16:07:13.371024486 -0700
@@ -331,23 +331,26 @@
     if not is_systemd_pid1():
         return False    # pragma: no cover
     #test it:
-    cmd = ["systemd-run", "--quiet", "--user", "--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:
+        cmd = ["systemd-run", "--quiet", "--user", "--scope", "--", "true"]
+        proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=False)
         try:
-            proc.terminate()
-        except Exception:
-            pass
-        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 run_mode(script_file, error_cb, options, args, mode, defaults):

debug log:

solving 8dfd9c82f0 ...
found 8dfd9c82f0 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).