lkml.org 
[lkml]   [2020]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scripts: kernel-doc: allow passing desired Sphinx C domain dialect
From
Date
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@lwn.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;
}


\
 
 \ /
  Last update: 2020-10-06 09:35    [W:0.068 / U:1.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site