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):
td>
|
Age | Commit message (Collapse) | Author |
|
Fixes <https://bugs.gnu.org/35582>.
Reported by sirgazil <sirgazil@zoho.com>.
Previously, leading zeros would be removed, leading to an "invalid"
UUID:
(uuid->string (uuid "00CA-050E" 'fat32))
⇒ "CA-50E"
(string->uuid "CA-50E" 'fat32)
⇒ #f
* gnu/system/uuid.scm (fat-uuid->string): Pad digits with zeros.
* tests/uuid.scm ("uuid, FAT32, leading zeros preserved"): New test.
|
|
* gnu/system/uuid.scm (uuid): When STR is not a literal, return #f when
'string->uuid' returns #f.
* tests/uuid.scm ("uuid, dynamic value"): New test.
|
|
* tests/uuid.scm ("uuid=?"): Change to 'test-assert'.
|
|
* gnu/system/uuid.scm (uuid=?): New procedure.
* tests/uuid.scm ("uuid=?"): New test.
* gnu/build/file-systems.scm (partition-uuid-predicate)
(luks-partition-uuid-predicate): Use it instead of 'bytevector=?'.
|
|
* gnu/system/uuid.scm (%fat32-uuid-rx): New variable.
(string->fat32-uuid): New procedure.
(%uuid-parsers): Add it.
* tests/uuid.scm ("uuid, FAT32, format preserved"): New test.
|
|
* tests/file-systems.scm ("uuid->string", "string->uuid")
("uuid", "uuid, syntax error"): Move to...
* tests/uuid.scm: ... here. New file.
("uuid, ISO-9660, format preserved"): New test.
|