mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Manuel Ebner <manuelebnerli@mailbox.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	workflows@vger.kernel.org,
	 open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ver_linux: add comparison with required version and colour to output
Date: Fri, 14 Aug 2026 16:00:07 +0200	[thread overview]
Message-ID: <CAMuHMdV461YV5jThYgoGAxnZhB3Vf5tAmcm-eML1o-jVRrerBA@mail.gmail.com> (raw)
In-Reply-To: <20260814134931.2281085-2-manuelebnerli@mailbox.org>

Hi Manuel,

On Fri, 14 Aug 2026 at 15:55, Manuel Ebner <manuelebnerli@mailbox.org> wrote:
> Add the required version from changes.rst.
> Add code for comparison and print in colour (blue, green, red) depending
> on the result of the comparison.
>
> Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org>

Thanks for your patch!

> --- a/scripts/ver_linux
> +++ b/scripts/ver_linux

> @@ -89,9 +92,17 @@ function version(cmd,    ver) {
>         return ver
>  }
>
> -function printversion(name, value,  ofmt) {
> -       if (value != "") {
> +function printversion(name, cur_version, req_version,  ofmt) {
> +       if (req_version == "") {
>                 ofmt = "%-20s\t%s\n"
> -               printf(ofmt, name, value)
> +               printf(ofmt, "\033[34m"name,  cur_version)
> +       }
> +       else if (cur_version >= req_version) {
> +               ofmt = "%-20s\t%s\n"
> +               printf(ofmt, "\033[32m"name,  cur_version)
> +       }
> +       else {
> +               ofmt = "%-20s\t%s\n"
> +               printf(ofmt, "\033[31m"name,  cur_version)
>         }
>  }

None of the above reset the color (using "\033[37m", or the shorter
"\033[0m").

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2026-08-14 14:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 13:49 Manuel Ebner
2026-08-14 14:00 ` Geert Uytterhoeven [this message]
2026-08-14 14:01 ` Jonathan Corbet

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=CAMuHMdV461YV5jThYgoGAxnZhB3Vf5tAmcm-eML1o-jVRrerBA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=corbet@lwn.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuelebnerli@mailbox.org \
    --cc=skhan@linuxfoundation.org \
    --cc=workflows@vger.kernel.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

all inboxes | Powered by JetHome®