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 8A88CC0015E for ; Thu, 20 Jul 2023 00:04:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9107E86911; Thu, 20 Jul 2023 01:53:07 +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="EAxH4PaV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 666A086800; Thu, 20 Jul 2023 01:51:08 +0200 (CEST) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (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 87211867E7 for ; Thu, 20 Jul 2023 01:50:59 +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-xd36.google.com with SMTP id ca18e2360f4ac-78374596182so9716839f.0 for ; Wed, 19 Jul 2023 16:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689810658; x=1690415458; 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=ZUlPLovbHKe8XpikjDkRi5o87eXtuCbWRiEsVRoR49U=; b=EAxH4PaVDdpL2xeUkKZDCcZOU5OTLNEpug0MwfRXdCViFHbbwRMwnFnio0vNnh6D4Y 4L5DNxcV7u06Kk4FO7uq2sOfRhT/cfxrT1pPpt5P73Y3dYnRhLMMvn52X3a3j6d1doUr R2J27dgd1f1P8SAFLr6v/3mZD13e0KmxzDu3Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689810658; x=1690415458; 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=ZUlPLovbHKe8XpikjDkRi5o87eXtuCbWRiEsVRoR49U=; b=l+DY1rSdj04PgTuemBns4gMxRrtiQsDkzvQ56Iq/lMtGGMoatN/jR81N/N7LxtFiJf T5RunCxX2JWX0W8CYrHVxn/NpydcJw9FPLno6CnqiQebVkbiSrAgW0r9F7HeQYhqB03z 9yVN/wuZJR4nOQv7L90ANcIKIxEykEaX2PFsiZWNmZjXq9Z9ACNp+WCmyvgI+ygXK8j9 e9ZG4cj0A3PG4upjGTHxN1JuYdGtaX9M4k5ba7AeVHhCF21xAgTdPngrou9wczSfiMZy UQ8TZwbA7fdE+f/TzX0t9IqER7KqmpFUxni3677IzQ39IQB1CtL2eNUDrMnt7WskRngp P33g== X-Gm-Message-State: ABy/qLZoanUVG+LPgO2a8pIFvjxyAwiFkCI0juOwbSg2E2OM2nu0NdWA WB+zu4sqQsVKEWtwJ4ZKNxZGd2ugbZ/+WpYPHG0= X-Google-Smtp-Source: APBJJlE9LOGT2vOoM+fovdwDEwJgMXvwdECa+KBjvexQ9g4XG51sSF+ME05InRUhlMDFiGIZrbLvzA== X-Received: by 2002:a5d:9956:0:b0:783:5fd9:3789 with SMTP id v22-20020a5d9956000000b007835fd93789mr6501529ios.1.1689810658214; Wed, 19 Jul 2023 16:50:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 16:50:58 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Mike Frysinger , Simon Glass Subject: [PATCH v4 79/83] buildman: Move copy_files() out ot BuilderThread class Date: Wed, 19 Jul 2023 17:49:27 -0600 Message-ID: <20230719234953.796101-80-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 This does not need to be in the class. Move it out to avoid a pylint warning. Signed-off-by: Simon Glass --- (no changes since v1) tools/buildman/builderthread.py | 47 +++++++++++++++++---------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py index ed84a0f6baa3..25f460c207db 100644 --- a/tools/buildman/builderthread.py +++ b/tools/buildman/builderthread.py @@ -64,6 +64,27 @@ def _remove_old_outputs(out_dir): os.remove(fname) +def copy_files(out_dir, build_dir, dirname, patterns): + """Copy files from the build directory to the output. + + Args: + out_dir (str): Path to output directory containing the files + build_dir (str): Place to copy the files + dirname (str): Source directory, '' for normal U-Boot, 'spl' for SPL + patterns (list of str): A list of filenames to copy, each relative + to the build directory + """ + for pattern in patterns: + file_list = glob.glob(os.path.join(out_dir, dirname, pattern)) + for fname in file_list: + target = os.path.basename(fname) + if dirname: + base, ext = os.path.splitext(target) + if ext: + target = f'{base}-{dirname}{ext}' + shutil.copy(fname, os.path.join(build_dir, target)) + + # pylint: disable=R0903 class BuilderJob: """Holds information about a job to be performed by a thread @@ -592,7 +613,7 @@ class BuilderThread(threading.Thread): capture_stderr=True, cwd=result.out_dir, raise_on_error=False, env=env) if not work_in_output: - self.copy_files(result.out_dir, build_dir, '', ['uboot.env']) + 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 @@ -607,7 +628,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.copy_files( + 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', @@ -615,31 +636,11 @@ class BuilderThread(threading.Thread): # Now write the actual build output if keep_outputs: - self.copy_files( + copy_files( result.out_dir, build_dir, '', ['u-boot*', '*.bin', '*.map', '*.img', 'MLO', 'SPL', 'include/autoconf.mk', 'spl/u-boot-spl*']) - def copy_files(self, out_dir, build_dir, dirname, patterns): - """Copy files from the build directory to the output. - - Args: - out_dir (str): Path to output directory containing the files - build_dir (str): Place to copy the files - dirname (str): Source directory, '' for normal U-Boot, 'spl' for SPL - patterns (list of str): A list of filenames to copy, each relative - to the build directory - """ - for pattern in patterns: - file_list = glob.glob(os.path.join(out_dir, dirname, pattern)) - for fname in file_list: - target = os.path.basename(fname) - if dirname: - base, ext = os.path.splitext(target) - if ext: - target = f'{base}-{dirname}{ext}' - shutil.copy(fname, os.path.join(build_dir, target)) - def _send_result(self, result): """Send a result to the builder for processing -- 2.41.0.487.g6d72f3e995-goog