summaryrefslogtreecommitdiffstats
path: root/python/mach
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /python/mach
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/mach')
-rw-r--r--python/mach/mach/command_util.py2
-rw-r--r--python/mach/mach/util.py15
2 files changed, 17 insertions, 0 deletions
diff --git a/python/mach/mach/command_util.py b/python/mach/mach/command_util.py
index 741539f6f6..e8238bd83e 100644
--- a/python/mach/mach/command_util.py
+++ b/python/mach/mach/command_util.py
@@ -134,6 +134,7 @@ MACH_COMMANDS = {
"mach-debug-commands": MachCommandReference(
"python/mach/mach/commands/commandinfo.py"
),
+ "macos-sign": MachCommandReference("tools/signing/macos/mach_commands.py"),
"manifest": MachCommandReference("testing/mach_commands.py"),
"marionette-test": MachCommandReference("testing/marionette/mach_commands.py"),
"mochitest": MachCommandReference("testing/mochitest/mach_commands.py", ["test"]),
@@ -203,6 +204,7 @@ MACH_COMMANDS = {
),
"tps-build": MachCommandReference("testing/tps/mach_commands.py"),
"try": MachCommandReference("tools/tryselect/mach_commands.py"),
+ "ts": MachCommandReference("tools/ts/mach_commands.py"),
"uniffi": MachCommandReference(
"toolkit/components/uniffi-bindgen-gecko-js/mach_commands.py"
),
diff --git a/python/mach/mach/util.py b/python/mach/mach/util.py
index 203f08f92b..b6bf1727fa 100644
--- a/python/mach/mach/util.py
+++ b/python/mach/mach/util.py
@@ -115,3 +115,18 @@ def to_optional_str(path: Optional[Path]):
return str(path)
else:
return None
+
+
+def strtobool(value: str):
+ # Reimplementation of distutils.util.strtobool
+ # https://docs.python.org/3.9/distutils/apiref.html#distutils.util.strtobool
+ true_vals = ("y", "yes", "t", "true", "on", "1")
+ false_vals = ("n", "no", "f", "false", "off", "0")
+
+ value = value.lower()
+ if value in true_vals:
+ return 1
+ if value in false_vals:
+ return 0
+
+ raise ValueError(f'Expected one of: {", ".join(true_vals + false_vals)}')