diff mbox series

[v6,02/21] binman: Avoid duplicates in bintool lists

Message ID 20220819142538.24847-3-stefan.herbrechtsmeier-oss@weidmueller.com
State Accepted
Commit facc378a869ebe2ee614f6ff9d18ab95fa37fe53
Delegated to: Simon Glass
Headers show
Series binman: Rework compression support | expand

Commit Message

Stefan Herbrechtsmeier Aug. 19, 2022, 2:25 p.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Avoid duplicate entries in the list of bintools used by the image and
the list of missing bintools.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

---

(no changes since v5)

Changes in v5:
- Add commit to avoid duplicates in bintool lists

 tools/binman/entry.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Simon Glass Aug. 20, 2022, 9:33 p.m. UTC | #1
On Fri, 19 Aug 2022 at 08:26, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Avoid duplicate entries in the list of bintools used by the image and
> the list of missing bintools.
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
> (no changes since v5)
>
> Changes in v5:
> - Add commit to avoid duplicates in bintool lists
>
>  tools/binman/entry.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Aug. 21, 2022, 12:10 a.m. UTC | #2
On Fri, 19 Aug 2022 at 08:26, Stefan Herbrechtsmeier
<stefan.herbrechtsmeier-oss@weidmueller.com> wrote:
>
> From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> Avoid duplicate entries in the list of bintools used by the image and
> the list of missing bintools.
>
> Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
>
> ---
>
> (no changes since v5)
>
> Changes in v5:
> - Add commit to avoid duplicates in bintool lists
>
>  tools/binman/entry.py | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index e3767aefa7..8f846e55b6 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -1047,7 +1047,8 @@  features to produce new behaviours.
         Args:
             bintool (Bintool): Bintool that was missing
         """
-        self.missing_bintools.append(bintool)
+        if bintool not in self.missing_bintools:
+            self.missing_bintools.append(bintool)
 
     def check_missing_bintools(self, missing_list):
         """Check if any entries in this section have missing bintools
@@ -1057,7 +1058,10 @@  features to produce new behaviours.
         Args:
             missing_list: List of Bintool objects to be added to
         """
-        missing_list += self.missing_bintools
+        for bintool in self.missing_bintools:
+            if bintool not in missing_list:
+                missing_list.append(bintool)
+
 
     def GetHelpTags(self):
         """Get the tags use for missing-blob help