DPDK patches and discussions
 help / color / mirror / Atom feed
From: luca.boccassi@gmail.com
To: dev@dpdk.org
Subject: [PATCH 2/2] docs: sort files lists in generator scripts
Date: Mon, 14 Nov 2022 14:22:25 +0000	[thread overview]
Message-ID: <20221114142225.85403-2-luca.boccassi@gmail.com> (raw)
In-Reply-To: <20221114142225.85403-1-luca.boccassi@gmail.com>

From: Luca Boccassi <bluca@debian.org>

In order to build the documentation in a reproducible manner, sort the lists of
files used as input, since walking the filesystem is not guaranteed to be done
in a stable order.
When converting the scripts from shell to python, sorting the input was lost.

Fixes: 53bb9a073f4f ("doc: rewrite shell scripts in Python")

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 doc/api/generate_doxygen.py  | 2 +-
 doc/api/generate_examples.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/api/generate_doxygen.py b/doc/api/generate_doxygen.py
index 2ccedf844e..d3a22869f6 100755
--- a/doc/api/generate_doxygen.py
+++ b/doc/api/generate_doxygen.py
@@ -13,7 +13,7 @@
     subprocess.run(doxygen_command, check=True, stdout=out)
 with open(out_file) as out, open(dep_file, 'w') as dep:
     print(f'{out_dir}:', end=' ', file=dep)
-    for line in out:
+    for line in sorted(out):
         match = re.match(pattern, line)
         if match:
             print(match.group(1), end=' ', file=dep)
diff --git a/doc/api/generate_examples.py b/doc/api/generate_examples.py
index c35e72f280..7315b3c356 100755
--- a/doc/api/generate_examples.py
+++ b/doc/api/generate_examples.py
@@ -11,7 +11,7 @@
 with open(f'{api_examples}.d', 'w') as dep:
     print(f'{api_examples}:', end=' ', file=dep)
     for root, _, files in os.walk(examples_dir):
-        for name in files:
+        for name in sorted(files):
             is_source = name.endswith('.c')
             if is_source or name == 'meson.build':
                 path = os.path.join(root, name)
@@ -23,7 +23,7 @@
     print('''/**
 @page examples DPDK Example Programs
 ''', file=out)
-    for path in sources:
+    for path in sorted(sources):
         # Produce consistent output with forward slashes on all systems.
         # Every \ in paths within examples directory is a separator, not escape.
         relpath = os.path.relpath(path, examples_dir).replace('\\', '/')
-- 
2.34.1


  reply	other threads:[~2022-11-14 14:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 14:22 [PATCH 1/2] docs: add +x to " luca.boccassi
2022-11-14 14:22 ` luca.boccassi [this message]
2022-11-14 14:29   ` [PATCH 2/2] docs: sort files lists in " Bruce Richardson
2022-11-22 14:27     ` Thomas Monjalon
2022-11-14 14:30 ` [PATCH 1/2] docs: add +x to " Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221114142225.85403-2-luca.boccassi@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).