Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1050282imi; Fri, 1 Jul 2022 01:51:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tCp5DCWXnjwNjTV4HkkbMM4Gv34xoUIhzPwipQghdA/jmY4PXOSrP70VYGpPCsQKUh0jwp X-Received: by 2002:aa7:8bd3:0:b0:527:d84d:fa83 with SMTP id s19-20020aa78bd3000000b00527d84dfa83mr15992380pfd.30.1656665480923; Fri, 01 Jul 2022 01:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656665480; cv=none; d=google.com; s=arc-20160816; b=WWcgaXRZmzPw7hJHm+Hc87FnvH9r+bk+f9gVfWs5fw66b3KYbzpG6eOrpsti5a9rvD 6RN4KhZr3IXb28QxFxkj9jr9ANQ3DVKjUDEAYxTPqs95CprM0j8iZRG5oKvKCD11pFzD wpfI5LzyU3phqrssV3Es3NnPMvMZ1JWZYNBcWdAdStyFv5WqOgeCGIPRb6773kLQFZx9 o6EjrhfuGDLHEWgyrha8B+AYuRtTHYI1fOBVX00iPCMzsN/tTwRhwu7gVChsYeUkhKNq MuwfSSJkKXZikC9/wFvBMdWRDCfiDi7tZNRuRLDJeJaNoemkOPKireK91jFqTsgVXyi+ /5fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=GIi9d9bRiQM6bjsnyjHJeCf3BXztuGGBwnkD1YP2aYE=; b=sR945LdXAhauSpsiZ0VDFZmoACiWjvjFme5biGojjNosxEgkZT5lb5vrsqvZZvKuWI QKcgcGU+3Q70ESBt6riMpgftRv0WVg7uVfjJ6Kngs7ANLbrZZIG7+/9rncpYbCZxvNmJ P11Pjc3jNHpFSR2q4sOxAdwAc1M2/cmQwPJ75xcS8ovbrgpocX/F5N+1CBJnfX5rK4zc qeOoGKNAmCvCGQgGNMqO3HpUB4OorSbCDkkKcMquunacvUw+bOfg+dEuUWgDVjz922bY TLHPb6KGEOrY7qvcZMJQcxfudpgXY2eKYQKc9P+VrrzQTPFwQpvY+U+muMINS4Ssp5iK /aZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u5jMWUu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a17090340c400b0015d093f3891si7531911pld.584.2022.07.01.01.51.09; Fri, 01 Jul 2022 01:51:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=u5jMWUu4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234680AbiGAItc (ORCPT + 99 others); Fri, 1 Jul 2022 04:49:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbiGAItM (ORCPT ); Fri, 1 Jul 2022 04:49:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D21E0DA; Fri, 1 Jul 2022 01:48:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BAE02621F9; Fri, 1 Jul 2022 08:48:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C1ADC341C6; Fri, 1 Jul 2022 08:48:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656665335; bh=q6GO+RA/vkKq8tjuoPuRJhM1OnZmuwwmIL2YmITsc+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5jMWUu4ZGh+zipLD92yG6S3biqgvWqIVE8J37n7tlhAC/EqzUFEtLUwfhFQqVf8k +gRwEzMudWiJ2vGVuHmtRTAXztevdl8R3ov28IvLQU2Hq/R5+Xo2HhiNLDokirmaSA liaypvRlpeTxTfTwske3Aexemhnx1RtJNfpwJWK5+C4T9LhkcGW5tyeXwhuD4khalf mGT2IqAf1/wT76KqRRpl6YBD6F4moSxMW90jxv3uqgqjdU+ZgW+yGuc0YiR8C3tvHF /2f6J8S/R4aaIRE1/ck71DMpiIJlVd5PNqjF30lrgl8MdbIt5mRQzc7+Z2KrbBt6Up WXaBVdOOqNs4A== Received: from mchehab by mail.kernel.org with local (Exim 4.95) (envelope-from ) id 1o7CKZ-006T9K-SY; Fri, 01 Jul 2022 09:48:51 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , ksummit-discuss@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] scripts: sphinx-pre-install: provide both venv and package installs Date: Fri, 1 Jul 2022 09:48:49 +0100 Message-Id: <22f35e31173b368b40252df5ff9f3ef42a87c409.1656664906.git.mchehab@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cc: "Jonathan Corbet" Cc: "Mauro Carvalho Chehab" Cc: Jonathan Corbet Cc: Mauro Carvalho Chehab Cc: ksummit-discuss@lists.linuxfoundation.org Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org As it is not a consensus about installing sphinx using venv, and modern distributions are now shipping with Sphinx versions above the minimal requirements to build the docs, provide both venv and package install commands by default. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/4] at: https://lore.kernel.org/all/cover.1656664906.git.mchehab@kernel.org/ scripts/sphinx-pre-install | 43 ++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index 930a6d058c12..27bac4fbe35b 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -25,6 +25,7 @@ my $need_sphinx = 0; my $need_pip = 0; my $need_virtualenv = 0; my $rec_sphinx_upgrade = 0; +my $verbose_warn_install = 1; my $install = ""; my $virtenv_dir = ""; my $python_cmd = ""; @@ -103,10 +104,12 @@ sub check_missing(%) next; } - if ($is_optional) { - print "Warning: better to also install \"$prog\".\n"; - } else { - print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; + if ($verbose_warn_install) { + if ($is_optional) { + print "Warning: better to also install \"$prog\".\n"; + } else { + print "ERROR: please install \"$prog\", otherwise, build won't work.\n"; + } } if (defined($map{$prog})) { $install .= " " . $map{$prog}; @@ -386,7 +389,8 @@ sub give_debian_hints() check_missing(\%map); return if (!$need && !$optional); - printf("You should run:\n\n\tsudo apt-get install $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo apt-get install $install\n"); } sub give_redhat_hints() @@ -458,10 +462,12 @@ sub give_redhat_hints() if (!$old) { # dnf, for Fedora 18+ - printf("You should run:\n\n\tsudo dnf install -y $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo dnf install -y $install\n"); } else { # yum, for RHEL (and clones) or Fedora version < 18 - printf("You should run:\n\n\tsudo yum install -y $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo yum install -y $install\n"); } } @@ -509,7 +515,8 @@ sub give_opensuse_hints() check_missing(\%map); return if (!$need && !$optional); - printf("You should run:\n\n\tsudo zypper install --no-recommends $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo zypper install --no-recommends $install\n"); } sub give_mageia_hints() @@ -553,7 +560,8 @@ sub give_mageia_hints() check_missing(\%map); return if (!$need && !$optional); - printf("You should run:\n\n\tsudo $packager_cmd $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo $packager_cmd $install\n"); } sub give_arch_linux_hints() @@ -583,7 +591,8 @@ sub give_arch_linux_hints() check_missing(\%map); return if (!$need && !$optional); - printf("You should run:\n\n\tsudo pacman -S $install\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n\tsudo pacman -S $install\n"); } sub give_gentoo_hints() @@ -610,7 +619,8 @@ sub give_gentoo_hints() return if (!$need && !$optional); - printf("You should run:\n\n"); + printf("You should run:\n") if ($verbose_warn_install); + printf("\n"); my $imagemagick = "media-gfx/imagemagick svg png"; my $cairo = "media-gfx/graphviz cairo pdf"; @@ -873,6 +883,16 @@ sub recommend_sphinx_version($) printf "\t. $virtenv_dir/bin/activate\n"; printf "\tpip install -r $requirement_file\n"; deactivate_help(); + + printf "\nAnother option would be to install Sphinx package with:\n"; + + %missing = (); + $pdf = 0; + $optional = 0; + add_package("python-sphinx", 0); + check_python_module("sphinx_rtd_theme", 1); + + check_distros(); } sub check_needs() @@ -945,6 +965,7 @@ sub check_needs() check_program("latexmk", 2) if ($pdf); # Do distro-specific checks and output distro-install commands + $verbose_warn_install = 0; check_distros(); if (!$python_cmd) { -- 2.36.1