[v3,1/4] recipetool: Sort output of guess_license function to be deterministic

Message ID 20211215160813.23368-1-stefan.herbrechtsmeier-oss@weidmueller.com
State Accepted, archived
Commit ff2a7520813b3f775f96879d1905222e08b8c83f
Headers show
Series [v3,1/4] recipetool: Sort output of guess_license function to be deterministic | expand

Commit Message

Stefan Herbrechtsmeier Dec. 15, 2021, 4:08 p.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Sort the output of guess_license function by license file to be
deterministic and to support self-testing.

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

---

Changes in v3:
- Add commit to fix selftest failure of autobuilder

 scripts/lib/recipetool/create.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 406c97f1c5..28224dbc24 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1201,7 +1201,7 @@  def guess_license(srctree, d):
                     fullpath = os.path.join(root, fn)
                     if not fullpath in licfiles:
                         licfiles.append(fullpath)
-    for licfile in licfiles:
+    for licfile in sorted(licfiles):
         md5value = bb.utils.md5_file(licfile)
         license = md5sums.get(md5value, None)
         if not license: