Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 324ECC0015E for ; Thu, 20 Jul 2023 00:00:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ED20F868BD; Thu, 20 Jul 2023 01:52:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KXo9uvMs"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B41C7867B9; Thu, 20 Jul 2023 01:50:52 +0200 (CEST) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 71CE1867F4 for ; Thu, 20 Jul 2023 01:50:45 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-785cbc5bfd2so8771839f.2 for ; Wed, 19 Jul 2023 16:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810644; x=1690415444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TFNf/YIQub6OYyK3KBgPctJhrfMn+yFPQQkIYBlRC84=; b=KXo9uvMstaZ6+Zfg4mHXo01Cgvym6LpDTaf31f9BAft2WIQCgoO2QcztG3titfsEfB K3jAzcneuXdcoOMxLyRve0dOWvJSzxV6sDv8tznzXyuvR1gClygxTURGReO7P7B4B8V4 /nvnQzUVxZg3XljQEoZ/gwAku+3vdwEz3jBHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810644; x=1690415444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TFNf/YIQub6OYyK3KBgPctJhrfMn+yFPQQkIYBlRC84=; b=Vqw+WihaZNwcaRB9zGVquq5ymZUD0ElNhNrev9QVVhdBXUI/iG93R3hyBlsiy/QDiy MGtx/ZY/WSkScrLwIoQTGxhZA4G6MzcujqTuiiH80ts7XOHWkJtQY/Q7MRAqSd24Kv/E uMGkxcNlHx+K029qHLO52peS2w6rxXbNao+SUll6HPmuTJtbWGkgqRUyRtk49kbA35cM SdcclQr5PuxKyojNC++FYwyycHk+K2Dj9oOqcFSn0wH9diqVEY6FSWCe91R62MpXij8a elW7A2qU1nQAka6yY35dYhOMWqg/RN1Czl1uvey4PZ7aWCPrD2vla6YC82KO97cmUXXe yeyA== X-Gm-Message-State: ABy/qLYrv4mNDFwSDPHN55cPylMuJZX8It6CCh4MVX1wBqvZ15EK68Hq PmyjcYKII6rGjheYq5N7cigqCH5cWNuoo6JbGG4= X-Google-Smtp-Source: APBJJlEKEF/NlJAmJeRCq5tB6ptA4NHBRNeDjWycM/Moy8/YpnsYd/RCJDa5fT5Q4jS97uVvxbuPYw== X-Received: by 2002:a05:6602:218c:b0:787:1990:d2de with SMTP id b12-20020a056602218c00b007871990d2demr6631781iob.5.1689810643957; Wed, 19 Jul 2023 16:50:43 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id ed16-20020a056638291000b0042bb1779c18sm1551779jab.151.2023.07.19.16.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 60/83] buildman: Convert camel case in builderthread.py Date: Wed, 19 Jul 2023 17:49:08 -0600 Message-ID: <20230719234953.796101-61-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog In-Reply-To: <20230719234953.796101-1-sjg@chromium.org> References: <20230719234953.796101-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Convert this file to snake case and update all files which use it. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builder.py | 8 +++--- tools/buildman/builderthread.py | 50 ++++++++++++++++----------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index 80c05fbd1e73..4cc266ff3049 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -1648,7 +1648,7 @@ class Builder: 'worktree' to set up a git worktree """ thread_dir = self.get_thread_dir(thread_num) - builderthread.Mkdir(thread_dir) + builderthread.mkdir(thread_dir) git_dir = os.path.join(thread_dir, '.git') # Create a worktree or a git repo clone for this thread if it @@ -1696,7 +1696,7 @@ class Builder: work setup_git: True to set up a git worktree or a git clone """ - builderthread.Mkdir(self._working_dir) + builderthread.mkdir(self._working_dir) if setup_git and self.git_dir: src_dir = os.path.abspath(self.git_dir) if gitutil.check_worktree_is_available(src_dir): @@ -1772,7 +1772,7 @@ class Builder: self._verbose = verbose self.reset_result_summary(board_selected) - builderthread.Mkdir(self.base_dir, parents = True) + builderthread.mkdir(self.base_dir, parents = True) self._prepare_working_space(min(self.num_threads, len(board_selected)), commits is not None) self._prepare_output_space() @@ -1793,7 +1793,7 @@ class Builder: if self.num_threads: self.queue.put(job) else: - self._single_builder.RunJob(job) + self._single_builder.run_job(job) if self.num_threads: term = threading.Thread(target=self.queue.join) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index 5f1200ae890f..3f52d95fed9f 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -16,7 +16,7 @@ from u_boot_pylib import command RETURN_CODE_RETRY = -1 BASE_ELF_FILENAMES = ['u-boot', 'spl/u-boot-spl', 'tpl/u-boot-tpl'] -def Mkdir(dirname, parents = False): +def mkdir(dirname, parents = False): """Make a directory if it doesn't already exist. Args: @@ -108,7 +108,7 @@ class BuilderThread(threading.Thread): self.per_board_out_dir = per_board_out_dir self.test_exception = test_exception - def Make(self, commit, brd, stage, cwd, *args, **kwargs): + def make(self, commit, brd, stage, cwd, *args, **kwargs): """Run 'make' on a particular commit and board. The source code will already be checked out, so the 'commit' @@ -130,7 +130,7 @@ class BuilderThread(threading.Thread): return self.builder.do_make(commit, brd, stage, cwd, *args, **kwargs) - def RunCommit(self, commit_upto, brd, work_dir, do_config, config_only, + def run_commit(self, commit_upto, brd, work_dir, do_config, config_only, force_build, force_build_failures, work_in_output, adjust_cfg): """Build a particular commit. @@ -163,7 +163,7 @@ class BuilderThread(threading.Thread): - boolean indicating whether 'make config' is still needed """ # Create a default result - it will be overwritte by the call to - # self.Make() below, in the event that we do a build. + # self.make() below, in the event that we do a build. result = command.CommandResult() result.return_code = 0 if work_in_output or self.builder.in_tree: @@ -226,7 +226,7 @@ class BuilderThread(threading.Thread): # Set up the environment and command line env = self.toolchain.MakeEnvironment(self.builder.full_path) - Mkdir(out_dir) + mkdir(out_dir) args = [] cwd = work_dir src_dir = os.path.realpath(work_dir) @@ -282,12 +282,12 @@ class BuilderThread(threading.Thread): if do_config or adjust_cfg: config_out = '' if self.mrproper: - result = self.Make(commit, brd, 'mrproper', cwd, + result = self.make(commit, brd, 'mrproper', cwd, 'mrproper', *args, env=env) config_out += result.combined cmd_list.append([self.builder.gnu_make, 'mrproper', *args]) - result = self.Make(commit, brd, 'config', cwd, + result = self.make(commit, brd, 'config', cwd, *(args + config_args), env=env) cmd_list.append([self.builder.gnu_make] + args + config_args) @@ -298,7 +298,7 @@ class BuilderThread(threading.Thread): if result.return_code == 0: if config_only: args.append('cfg') - result = self.Make(commit, brd, 'build', cwd, *args, + result = self.make(commit, brd, 'build', cwd, *args, env=env) cmd_list.append([self.builder.gnu_make] + args) if (result.return_code == 2 and @@ -326,7 +326,7 @@ class BuilderThread(threading.Thread): result.out_dir = out_dir return result, do_config - def _WriteResult(self, result, keep_outputs, work_in_output): + def _write_result(self, result, keep_outputs, work_in_output): """Write a built result to the output directory. Args: @@ -346,10 +346,10 @@ class BuilderThread(threading.Thread): # Write the output and stderr output_dir = self.builder._get_output_dir(result.commit_upto) - Mkdir(output_dir) + mkdir(output_dir) build_dir = self.builder.get_build_dir(result.commit_upto, result.brd.target) - Mkdir(build_dir) + mkdir(build_dir) outfile = os.path.join(build_dir, 'log') with open(outfile, 'w') as fd: @@ -440,7 +440,7 @@ class BuilderThread(threading.Thread): raise_on_error=False, env=env) ubootenv = os.path.join(result.out_dir, 'uboot.env') if not work_in_output: - self.CopyFiles(result.out_dir, build_dir, '', ['uboot.env']) + self.copy_files(result.out_dir, build_dir, '', ['uboot.env']) # Write out the image sizes file. This is similar to the output # of binutil's 'size' utility, but it omits the header line and @@ -455,7 +455,7 @@ class BuilderThread(threading.Thread): if not work_in_output: # Write out the configuration files, with a special case for SPL for dirname in ['', 'spl', 'tpl']: - self.CopyFiles( + self.copy_files( result.out_dir, build_dir, dirname, ['u-boot.cfg', 'spl/u-boot-spl.cfg', 'tpl/u-boot-tpl.cfg', '.config', 'include/autoconf.mk', @@ -463,12 +463,12 @@ class BuilderThread(threading.Thread): # Now write the actual build output if keep_outputs: - self.CopyFiles( + self.copy_files( result.out_dir, build_dir, '', ['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL', 'include/autoconf.mk', 'spl/u-boot-spl*']) - def CopyFiles(self, out_dir, build_dir, dirname, patterns): + def copy_files(self, out_dir, build_dir, dirname, patterns): """Copy files from the build directory to the output. Args: @@ -488,7 +488,7 @@ class BuilderThread(threading.Thread): target = '%s-%s%s' % (base, dirname, ext) shutil.copy(fname, os.path.join(build_dir, target)) - def _SendResult(self, result): + def _send_result(self, result): """Send a result to the builder for processing Args: @@ -504,7 +504,7 @@ class BuilderThread(threading.Thread): else: self.builder.process_result(result) - def RunJob(self, job): + def run_job(self, job): """Run a single job A job consists of a building a list of commits for a particular board. @@ -524,7 +524,7 @@ class BuilderThread(threading.Thread): commit_upto = 0 force_build = False for commit_upto in range(0, len(job.commits), job.step): - result, request_config = self.RunCommit(commit_upto, brd, + result, request_config = self.run_commit(commit_upto, brd, work_dir, do_config, self.builder.config_only, force_build or self.builder.force_build, self.builder.force_build_failures, @@ -535,7 +535,7 @@ class BuilderThread(threading.Thread): # If our incremental build failed, try building again # with a reconfig. if self.builder.force_config_on_failure: - result, request_config = self.RunCommit(commit_upto, + result, request_config = self.run_commit(commit_upto, brd, work_dir, True, False, True, False, job.work_in_output, job.adjust_cfg) did_config = True @@ -576,17 +576,17 @@ class BuilderThread(threading.Thread): raise ValueError('Interrupt') # We have the build results, so output the result - self._WriteResult(result, job.keep_outputs, job.work_in_output) - self._SendResult(result) + self._write_result(result, job.keep_outputs, job.work_in_output) + self._send_result(result) else: # Just build the currently checked-out build - result, request_config = self.RunCommit(None, brd, work_dir, True, + result, request_config = self.run_commit(None, brd, work_dir, True, self.builder.config_only, True, self.builder.force_build_failures, job.work_in_output, job.adjust_cfg) result.commit_upto = 0 - self._WriteResult(result, job.keep_outputs, job.work_in_output) - self._SendResult(result) + self._write_result(result, job.keep_outputs, job.work_in_output) + self._send_result(result) def run(self): """Our thread's run function @@ -597,7 +597,7 @@ class BuilderThread(threading.Thread): while True: job = self.builder.queue.get() try: - self.RunJob(job) + self.run_job(job) except Exception as e: print('Thread exception (use -T0 to run without threads):', e) self.builder.thread_exceptions.append(e) -- 2.41.0.487.g6d72f3e995-goog