[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250618124019.GQ1699@horms.kernel.org>
Date: Wed, 18 Jun 2025 13:40:19 +0100
From: Simon Horman <horms@...nel.org>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Jonathan Corbet <corbet@....net>, Akira Yokosawa <akiyks@...il.com>,
Breno Leitao <leitao@...ian.org>,
"David S. Miller" <davem@...emloft.net>,
Donald Hunter <donald.hunter@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
Ignacio Encinas Rubio <ignacio@...cinas.com>,
Jan Stancek <jstancek@...hat.com>, Marco Elver <elver@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Ruben Wauters <rubenru09@....com>,
Shuah Khan <skhan@...uxfoundation.org>, joel@...lfernandes.org,
linux-kernel-mentees@...ts.linux.dev, linux-kernel@...r.kernel.org,
lkmm@...ts.linux.dev, netdev@...r.kernel.org, peterz@...radead.org,
stern@...land.harvard.edu
Subject: Re: [PATCH v5 05/15] tools: ynl_gen_rst.py: make the index parser
more generic
On Wed, Jun 18, 2025 at 08:57:35AM +0200, Mauro Carvalho Chehab wrote:
> Em Tue, 17 Jun 2025 12:59:27 +0100
> Simon Horman <horms@...nel.org> escreveu:
>
> > On Tue, Jun 17, 2025 at 10:02:02AM +0200, Mauro Carvalho Chehab wrote:
> > > It is not a good practice to store build-generated files
> > > inside $(srctree), as one may be using O=<BUILDDIR> and even
> > > have the Kernel on a read-only directory.
> > >
> > > Change the YAML generation for netlink files to allow it
> > > to parse data based on the source or on the object tree.
> > >
> > > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> > > ---
> > > tools/net/ynl/pyynl/ynl_gen_rst.py | 22 ++++++++++++++++------
> > > 1 file changed, 16 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/tools/net/ynl/pyynl/ynl_gen_rst.py b/tools/net/ynl/pyynl/ynl_gen_rst.py
> > > index 7bfb8ceeeefc..b1e5acafb998 100755
> > > --- a/tools/net/ynl/pyynl/ynl_gen_rst.py
> > > +++ b/tools/net/ynl/pyynl/ynl_gen_rst.py
> > > @@ -365,6 +365,7 @@ def parse_arguments() -> argparse.Namespace:
> > >
> > > parser.add_argument("-v", "--verbose", action="store_true")
> > > parser.add_argument("-o", "--output", help="Output file name")
> > > + parser.add_argument("-d", "--input_dir", help="YAML input directory")
> > >
> > > # Index and input are mutually exclusive
> > > group = parser.add_mutually_exclusive_group()
> > > @@ -405,11 +406,14 @@ def write_to_rstfile(content: str, filename: str) -> None:
> > > """Write the generated content into an RST file"""
> > > logging.debug("Saving RST file to %s", filename)
> > >
> > > + dir = os.path.dirname(filename)
> > > + os.makedirs(dir, exist_ok=True)
> > > +
> > > with open(filename, "w", encoding="utf-8") as rst_file:
> > > rst_file.write(content)
> >
> > Hi Mauro,
> >
> > With this patch applied I see the following, which did not happen before.
>
> Thanks! this was an intermediate step. I'll just drop this patch and
> fix conflicts at the next version.
Likewise, thanks.
Powered by blists - more mailing lists