[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1396a58e7155f13b9c24daffabafa29d8d9106a5.camel@perches.com>
Date: Tue, 06 Oct 2020 00:34:39 -0700
From: Joe Perches <joe@...ches.com>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Jonathan Corbet <corbet@....net>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
Changbin Du <changbin.du@...el.com>,
linux-kernel@...r.kernel.org,
Markus Heiser <markus.heiser@...marit.de>
Subject: Re: [PATCH] scripts: kernel-doc: allow passing desired Sphinx C
domain dialect
On Tue, 2020-10-06 at 08:42 +0200, Mauro Carvalho Chehab wrote:
> Em Mon, 5 Oct 2020 10:17:36 -0600
> Jonathan Corbet <corbet@....net> escreveu:
[]
> Sure. It should be easy to make the third argument optional, although
> the regex will be a little more harder to understand.
>
> Something like this should do the trick:
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
[]
> @@ -466,12 +466,16 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
> $show_not_found = 1; # A no-op but don't fail
> } elsif ($cmd eq "sphinx-version") {
> my $ver_string = shift @ARGV;
> - if ($ver_string =~ m/^(\d+)\.(\d+)\.(\d+)/) {
> + if ($ver_string =~ m/^(\d+)\.(\d+)(?:\.?(\d+)?)/) {
trivia: perhaps more readable as
if ($ver_string =~ m/^(\d+)\.(\d+)(\.\d+)?/) {
$sphinx_major = $1;
$sphinx_minor = $2;
if (defined($3)) {
$sphinx_patch = substr($3,1);
} else {
$sphinx_patch = 0;
}
Powered by blists - more mailing lists