Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1558717/?format=api
{ "id": 1558717, "url": "http://patchwork.ozlabs.org/api/patches/1558717/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20211123180354.615946-11-sjg@chromium.org/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20211123180354.615946-11-sjg@chromium.org>", "list_archive_url": null, "date": "2021-11-23T18:03:47", "name": "[10/17] binman: Allow overriding BuildSectionData()", "commit_ref": "d34bcdd054d4c9ccbbbc49a267168e5ad1bc0e78", "pull_url": null, "state": "accepted", "archived": false, "hash": "d5fef2d13d59f8cab098405e6c792fc82d10bdd7", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3184, "url": "http://patchwork.ozlabs.org/api/users/3184/?format=api", "username": "sjg", "first_name": "Simon", "last_name": "Glass", "email": "sjg@chromium.org" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20211123180354.615946-11-sjg@chromium.org/mbox/", "series": [ { "id": 273476, "url": "http://patchwork.ozlabs.org/api/series/273476/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=273476", "date": "2021-11-23T18:03:37", "name": "binman: Various tidy-ups and refactors", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/273476/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1558717/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1558717/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Authentication-Results": [ "bilbo.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=FRTaick2;\n\tdkim-atps=neutral", "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org\n header.b=\"FRTaick2\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.org" ], "Received": [ "from phobos.denx.de (phobos.denx.de [85.214.62.61])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby bilbo.ozlabs.org (Postfix) with ESMTPS id 4HzBsL0Jw1z9ssD\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 24 Nov 2021 05:06:13 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 45F2583769;\n\tTue, 23 Nov 2021 19:05:13 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id 0D9BC83681; Tue, 23 Nov 2021 19:04:37 +0100 (CET)", "from mail-ot1-x335.google.com (mail-ot1-x335.google.com\n [IPv6:2607:f8b0:4864:20::335])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 830CA83681\n for <u-boot@lists.denx.de>; Tue, 23 Nov 2021 19:04:27 +0100 (CET)", "by mail-ot1-x335.google.com with SMTP id\n x19-20020a9d7053000000b0055c8b39420bso162063otj.1\n for <u-boot@lists.denx.de>; Tue, 23 Nov 2021 10:04:27 -0800 (PST)", "from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net.\n [67.190.101.114])\n by smtp.gmail.com with ESMTPSA id c8sm2357514otk.40.2021.11.23.10.04.21\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 23 Nov 2021 10:04:21 -0800 (PST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,\n SPF_PASS autolearn=ham autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n s=google;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=WWG56jezKYN34vbkAnrFm5zzyPrKA3rgZRh/IrHPFuo=;\n b=FRTaick2EzH+TAgDwSQpt7paskJcjFZbvO7MsZrz4Abx3RAdGdx0SfFNZE1Lr1QC6M\n Jz9bWAz8S5L5K1ED8/plRhnqEUQ9NKjPZbeUrOcncPiRzAIAzM02Q8BwMyL7vD4Do98+\n +zn6cZjklZJPFRNLBppfN/9GZF5jGFTs7aMr0=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=WWG56jezKYN34vbkAnrFm5zzyPrKA3rgZRh/IrHPFuo=;\n b=KnhTpS/jfpFY3dNGTb7i0afoOgT6y1/MZUah1yHjMnyxFj0kl3eF/BoE5xEIOhY9j4\n cwYkGf+A0YHtUwak7fGcq/oNX0cBhVnCNW4kvLQZ1CxQ0ZtrvEiRIBOuhntVSmxGuWoh\n dT8qlfyBTLkPqt92rW+07jn0Fkux34A1VPCnb+Y59QY5movOzSyP1inw7k0Rzkg1y6u0\n 3jB1k47b4O0IlYvwt/GM8DZYsSYukqyMIwb0bJ+2ukh8f/x08/rkdbV30WszQLN6Tezb\n SzT3//WEPZo23qm/Bejj/kCi/Jv6dTw5mTKGc9ZGZNh8OomuXs/XgJSVC9udTanTejv6\n JbOg==", "X-Gm-Message-State": "AOAM531tPUDm8q2S+mDqPtmq3GlV/s35FVVvXKql/bKh+sCDQfV+B/r6\n fEqnMtr6Rdz2jb9ZIOHx5AwO7LARpEDHcg==", "X-Google-Smtp-Source": "\n ABdhPJwHC1W6TtmTQm7wBBZIx74kadTQeIYuBxhlaCiP9b5WUmhJrmG4jigJ/Yg+iMM9zZ0hfxsEiA==", "X-Received": "by 2002:a9d:7758:: with SMTP id t24mr6386260otl.264.1637690661860;\n Tue, 23 Nov 2021 10:04:21 -0800 (PST)", "From": "Simon Glass <sjg@chromium.org>", "To": "U-Boot Mailing List <u-boot@lists.denx.de>", "Cc": "Tom Rini <trini@konsulko.com>,\n\tSimon Glass <sjg@chromium.org>", "Subject": "[PATCH 10/17] binman: Allow overriding BuildSectionData()", "Date": "Tue, 23 Nov 2021 11:03:47 -0700", "Message-Id": "<20211123180354.615946-11-sjg@chromium.org>", "X-Mailer": "git-send-email 2.34.0.rc2.393.gf8c9666880-goog", "In-Reply-To": "<20211123180354.615946-1-sjg@chromium.org>", "References": "<20211123180354.615946-1-sjg@chromium.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.37", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.2 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "This method is currently marked private. However it is useful to be able\nto subclass it, since much of the entry_Section code can be reused. Rename\nit.\n\nAlso document one confusing part of this code, so people can understand\nhow to add a test for this case.\n\nFix up a few pylint warnings to avoid regressing the score.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n tools/binman/etype/section.py | 16 ++++++++++++----\n tools/binman/ftest.py | 2 +-\n 2 files changed, 13 insertions(+), 5 deletions(-)", "diff": "diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py\nindex 952c01de186..334240384ea 100644\n--- a/tools/binman/etype/section.py\n+++ b/tools/binman/etype/section.py\n@@ -182,7 +182,7 @@ class Entry_section(Entry):\n \n return data\n \n- def _BuildSectionData(self, required):\n+ def BuildSectionData(self, required):\n \"\"\"Build the contents of a section\n \n This places all entries at the right place, dealing with padding before\n@@ -190,6 +190,9 @@ class Entry_section(Entry):\n pad-before and pad-after properties in the section items) since that is\n handled by the parent section.\n \n+ This should be overridden by subclasses which want to build their own\n+ data structure for the section.\n+\n Args:\n required: True if the data must be present, False if it is OK to\n return None\n@@ -201,6 +204,9 @@ class Entry_section(Entry):\n \n for entry in self._entries.values():\n entry_data = entry.GetData(required)\n+\n+ # This can happen when this section is referenced from a collection\n+ # earlier in the image description. See testCollectionSection().\n if not required and entry_data is None:\n return None\n data = self.GetPaddedDataForEntry(entry, entry_data)\n@@ -250,7 +256,7 @@ class Entry_section(Entry):\n This excludes any padding. If the section is compressed, the\n compressed data is returned\n \"\"\"\n- data = self._BuildSectionData(required)\n+ data = self.BuildSectionData(required)\n if data is None:\n return None\n self.SetContents(data)\n@@ -278,7 +284,7 @@ class Entry_section(Entry):\n self._SortEntries()\n self._ExpandEntries()\n \n- data = self._BuildSectionData(True)\n+ data = self.BuildSectionData(True)\n self.SetContents(data)\n \n self.CheckSize()\n@@ -735,7 +741,9 @@ class Entry_section(Entry):\n nothing.\n \n Args:\n- missing: List of missing properties / entry args, each a string\n+ entry (Entry): Entry to raise the error on\n+ missing (list of str): List of missing properties / entry args, each\n+ a string\n \"\"\"\n if not self._ignore_missing:\n missing = ', '.join(missing)\ndiff --git a/tools/binman/ftest.py b/tools/binman/ftest.py\nindex 6a36e8f3158..3982560c47c 100644\n--- a/tools/binman/ftest.py\n+++ b/tools/binman/ftest.py\n@@ -4533,7 +4533,7 @@ class TestFunctional(unittest.TestCase):\n def testCollectionSection(self):\n \"\"\"Test a collection where a section must be built first\"\"\"\n # Sections never have their contents when GetData() is called, but when\n- # _BuildSectionData() is called with required=True, a section will force\n+ # BuildSectionData() is called with required=True, a section will force\n # building the contents, producing an error is anything is still\n # missing.\n data = self._DoReadFile('199_collection_section.dts')\n", "prefixes": [ "10/17" ] }