From patchwork Fri May 15 06:30:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ovidiu Panait X-Patchwork-Id: 1290881 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=windriver.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Ndr15hTzz9sT8 for ; Fri, 15 May 2020 16:32:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 757ED81F70; Fri, 15 May 2020 08:32:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2F8AD81F82; Fri, 15 May 2020 08:32:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 09B4781F6C for ; Fri, 15 May 2020 08:32:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=windriver.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Ovidiu.Panait@windriver.com Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail.windriver.com (8.15.2/8.15.2) with ESMTPS id 04F6WCxH000824 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 14 May 2020 23:32:13 -0700 (PDT) Received: from otp-linux01.wrs.com (128.224.126.17) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.487.0; Thu, 14 May 2020 23:32:00 -0700 From: Ovidiu Panait To: Subject: [PATCH] buildman: Remove _of_#_ from results directory paths Date: Fri, 15 May 2020 09:30:12 +0300 Message-ID: <20200515063012.29984-1-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean Currently, the following scenario will rebuild the first commit even though it is not really necessary - the commit sha or the position in the patchset did not change: $ git am $ tools/buildman/buildman -P -E -W -b master mx6 $ git am $ tools/buildman/buildman -P -E -W -b master mx6 <- will rebuild the first commit as well, even though nothing has changed about it. This is due to the fact that previous results directories get removed when the number of commits change. By removing the _of_#_ part of the directory path, the commits will be rebuilt only if the commit sha or the position in the patchset changes. Also, update the testcase to reflect this change. Signed-off-by: Ovidiu Panait Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- tools/buildman/builder.py | 10 +++++----- tools/buildman/test.py | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py index f8e71de427..f2756ea666 100644 --- a/tools/buildman/builder.py +++ b/tools/buildman/builder.py @@ -70,12 +70,12 @@ As an example, say we are building branch 'us-net' for boards 'sandbox' and like this: us-net/ base directory - 01_of_02_g4ed4ebc_net--Add-tftp-speed-/ + 01_g4ed4ebc_net--Add-tftp-speed-/ sandbox/ u-boot.bin seaboard/ u-boot.bin - 02_of_02_g4ed4ebc_net--Check-tftp-comp/ + 02_g4ed4ebc_net--Check-tftp-comp/ sandbox/ u-boot.bin seaboard/ @@ -487,8 +487,8 @@ class Builder: commit = self.commits[commit_upto] subject = commit.subject.translate(trans_valid_chars) # See _GetOutputSpaceRemovals() which parses this name - commit_dir = ('%02d_of_%02d_g%s_%s' % (commit_upto + 1, - self.commit_count, commit.hash, subject[:20])) + commit_dir = ('%02d_g%s_%s' % (commit_upto + 1, + commit.hash, subject[:20])) elif not self.no_subdirs: commit_dir = 'current' if not commit_dir: @@ -1599,7 +1599,7 @@ class Builder: for dirname in glob.glob(os.path.join(self.base_dir, '*')): if dirname not in dir_list: leaf = dirname[len(self.base_dir) + 1:] - m = re.match('[0-9]+_of_[0-9]+_g[0-9a-f]+_.*', leaf) + m = re.match('[0-9]+_g[0-9a-f]+_.*', leaf) if m: to_remove.append(dirname) return to_remove diff --git a/tools/buildman/test.py b/tools/buildman/test.py index 40811ba9f9..82d25cfcaa 100644 --- a/tools/buildman/test.py +++ b/tools/buildman/test.py @@ -541,7 +541,7 @@ class TestBuild(unittest.TestCase): build.commits = self.commits build.commit_count = len(self.commits) subject = self.commits[1].subject.translate(builder.trans_valid_chars) - dirname ='/%02d_of_%02d_g%s_%s' % (2, build.commit_count, commits[1][0], + dirname ='/%02d_g%s_%s' % (2, build.commit_count, commits[1][0], subject[:20]) self.CheckDirs(build, dirname) @@ -609,9 +609,9 @@ class TestBuild(unittest.TestCase): base_dir = tempfile.mkdtemp() # Add various files that we want removed and left alone - to_remove = ['01_of_22_g0982734987_title', '102_of_222_g92bf_title', - '01_of_22_g2938abd8_title'] - to_leave = ['something_else', '01-something.patch', '01_of_22_another'] + to_remove = ['01_g0982734987_title', '102_g92bf_title', + '01_g2938abd8_title'] + to_leave = ['something_else', '01-something.patch', '01_another'] for name in to_remove + to_leave: _Touch(name)