mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Joe Perches <joe@perches.com>, Sasha Levin <sashal@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2] get_maintainer: lazy load JSON::PP only when --json is used
Date: Fri, 30 Oct 2026 17:29:59 +0100	[thread overview]
Message-ID: <auTGBz2VI1sgaayK@redhat.com> (raw)
In-Reply-To: <auS7NOsyw7pJ7rbF@redhat.com>

After commit 09d8b39563e8 ("get_maintainer: add --json output mode"),
I can no longer use get_maintainer.pl; it fails at compile time if
JSON::PP is not installed even when --json is not requested.

This module is only needed with the --json option. Use "require" to
load this module dynamically inside the "if ($json)" block instead.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 scripts/get_maintainer.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 16b80a700d4a..b31b4016802f 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -21,7 +21,6 @@ use Cwd;
 use File::Find;
 use File::Spec::Functions;
 use open qw(:std :encoding(UTF-8));
-use JSON::PP;
 
 my $cur_path = fastgetcwd() . '/';
 my $lk_path = "./";
@@ -663,6 +662,8 @@ my @maintainers = get_maintainers();
 @bug = uniq(@bug) if ($bug);
 
 if ($json) {
+    require JSON::PP;
+
     my @json_maintainers;
     for my $m (@maintainers) {
 	my ($addr, $role);
-- 
2.55.0



      parent reply	other threads:[~2026-10-30 16:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 15:43 [PATCH] " Oleg Nesterov
2026-10-30 16:07 ` Joe Perches
2026-10-30 16:17   ` Oleg Nesterov
2026-10-30 16:32     ` Joe Perches
2026-10-30 21:44       ` Oleg Nesterov
2026-10-30 22:18         ` Sasha Levin
2026-10-30 22:19         ` Joe Perches
2026-10-30 22:55           ` Oleg Nesterov
2026-10-30 23:17             ` Joe Perches
2026-10-30 23:35               ` Oleg Nesterov
2026-10-30 23:54                 ` Joe Perches
2026-10-31  0:11                   ` Oleg Nesterov
2026-10-30 16:29 ` Oleg Nesterov [this message]

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=auTGBz2VI1sgaayK@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@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®