From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- python/mach/mach/command_util.py | 2 ++ python/mach/mach/util.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'python/mach') 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)}') -- cgit v1.2.3