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 --- .../docker/funsize-update-generator/scripts/funsize.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'taskcluster/docker/funsize-update-generator') diff --git a/taskcluster/docker/funsize-update-generator/scripts/funsize.py b/taskcluster/docker/funsize-update-generator/scripts/funsize.py index 84fd2fbd0b..0e72da46fc 100644 --- a/taskcluster/docker/funsize-update-generator/scripts/funsize.py +++ b/taskcluster/docker/funsize-update-generator/scripts/funsize.py @@ -13,7 +13,6 @@ import shutil import tempfile import time from contextlib import AsyncExitStack -from distutils.util import strtobool from pathlib import Path import aiohttp @@ -51,6 +50,22 @@ BCJ_OPTIONS = { } +def strtobool(value: str): + # Copied from `mach.util` since this script runs outside of a mach environment + # 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)}') + + def verify_signature(mar, cert): log.info("Checking %s signature", mar) with open(mar, "rb") as mar_fh: -- cgit v1.2.3