Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1064811ybl; Wed, 14 Aug 2019 10:08:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv7PFdQpc/+99qCC4WWCg7OJ7EutuhIr8xuW8cgoctQx1hv6UJkXgKAVAHnUhW7wJvd8n4 X-Received: by 2002:a62:8343:: with SMTP id h64mr948743pfe.170.1565802511433; Wed, 14 Aug 2019 10:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802511; cv=none; d=google.com; s=arc-20160816; b=0p/6dGqPnfimS/iRhcvTlSXFvHszS8g2xlCVNEYFyoRgyMUAyJqVxouwaRzldta82L RAGQLlacTjqa7UCFoOb28iYDUFVvVoR1q8faEodkGHYiZPOkts5AcsJjHbpiOBAb7IU6 ZhcARZE+kDyb+7XADYEULvHk3MBs9/Sea+dJxkzX/V/YXUBxkMJXf1ssg1d5iJzHrtWB gAG6hnQsMoiQ40CHV3WhUULilIZagmc79GMoiyR0LS0cJU2lD+RrB7FEBg7mVnQaiYtz yukCKx5rD7/Djo/eVvYvqrsB1OYpfFOcU/dKls1w84nGAIm3P0ru/gmACqxF/y96NTLy wAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r3o4K28EqHJ3nj7BAc9MDw66FAnHFsTyBL+pF8sh6OM=; b=ydsYdWn8sosArSjSWHvLJXjFbFp9A7lNORTUywn29XhlrZFDOADhfeQ9SH0rz/ZWA2 zDS2clMdsc+xyOz7svOSqz+HnSHDV2i7ItBGthirWp4JeXLJX2Z/ZhbFPjuPX+uSP0Yg 8koZt+z7cImpxRGLBmTKBaMw7Z4H6/YUij9/iYZ93/tcF9ULLpd/M0Pb56Lbpsnb4i8u sjeTcqFIO91ohXUv+EYMfiD+do215SaDiA24IjYLdZgB84nbNkP7FAOaSV8UVyGtBHu8 b2YOP3MEQltt3yPsxVRUQjeIEwQgwymGThSd86pP2Gi5iQbWyBPbL2mZD8F1ih7St2JW 4ISw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gRgTbOsp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si234263pls.334.2019.08.14.10.08.16; Wed, 14 Aug 2019 10:08:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gRgTbOsp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728550AbfHNRFi (ORCPT + 99 others); Wed, 14 Aug 2019 13:05:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729462AbfHNRFf (ORCPT ); Wed, 14 Aug 2019 13:05:35 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B57DF216F4; Wed, 14 Aug 2019 17:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802335; bh=T453qyHZq//8+NhURIFxQ7lt1tKfZfZY7GS3Gieo0rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gRgTbOspI9em98FXj1PqQaUwU5PXWLIH7TtvW7I9ISGtwq9HYEExo5VeVFkWwHMbg UGLRnVo5YBIvjTskpOKPJRZkxKSZ7vUvg6h+cn/9CuvjcLU/+JyUtpesdj9LH6NbTd Uh6VgpJrz425Cixe2NixVKq7/SE3o4PtP77opLjo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 058/144] scripts/sphinx-pre-install: dont use LaTeX with CentOS 7 Date: Wed, 14 Aug 2019 19:00:14 +0200 Message-Id: <20190814165802.258827525@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165759.466811854@linuxfoundation.org> References: <20190814165759.466811854@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 56e5a633923793b31515795ad30156a307572c1e ] There aren't enough texlive packages for LaTeX-based builds to work on CentOS/RHEL <= 7. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- scripts/sphinx-pre-install | 68 ++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index 778f3ae918775..4cc2b3ee5209f 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -77,6 +77,17 @@ sub check_missing(%) foreach my $prog (sort keys %missing) { my $is_optional = $missing{$prog}; + # At least on some LTS distros like CentOS 7, texlive doesn't + # provide all packages we need. When such distros are + # detected, we have to disable PDF output. + # + # So, we need to ignore the packages that distros would + # need for LaTeX to work + if ($is_optional == 2 && !$pdf) { + $optional--; + next; + } + if ($is_optional) { print "Warning: better to also install \"$prog\".\n"; } else { @@ -326,10 +337,10 @@ sub give_debian_hints() if ($pdf) { check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", - "fonts-dejavu", 1); + "fonts-dejavu", 2); } - check_program("dvipng", 1) if ($pdf); + check_program("dvipng", 2) if ($pdf); check_missing(\%map); return if (!$need && !$optional); @@ -364,22 +375,40 @@ sub give_redhat_hints() # # Checks valid for RHEL/CentOS version 7.x. # + my $old = 0; + my $rel; + $rel = $1 if ($system_release =~ /release\s+(\d+)/); + if (!($system_release =~ /Fedora/)) { $map{"virtualenv"} = "python-virtualenv"; - } - my $release; + if ($rel && $rel < 8) { + $old = 1; + $pdf = 0; - $release = $1 if ($system_release =~ /Fedora\s+release\s+(\d+)/); + printf("Note: texlive packages on RHEL/CENTOS <= 7 are incomplete. Can't support PDF output\n"); + printf("If you want to build PDF, please read:\n"); + printf("\thttps://www.systutorials.com/241660/how-to-install-tex-live-on-centos-7-linux/\n"); + } + } else { + if ($rel && $rel < 26) { + $old = 1; + } + } + if (!$rel) { + printf("Couldn't identify release number\n"); + $old = 1; + $pdf = 0; + } - check_rpm_missing(\@fedora26_opt_pkgs, 1) if ($pdf && $release >= 26); - check_rpm_missing(\@fedora_tex_pkgs, 1) if ($pdf); - check_missing_tex(1) if ($pdf); + check_rpm_missing(\@fedora26_opt_pkgs, 2) if ($pdf && !$old); + check_rpm_missing(\@fedora_tex_pkgs, 2) if ($pdf); + check_missing_tex(2) if ($pdf); check_missing(\%map); return if (!$need && !$optional); - if ($release >= 18) { + if (!$old) { # dnf, for Fedora 18+ printf("You should run:\n\n\tsudo dnf install -y $install\n"); } else { @@ -418,8 +447,8 @@ sub give_opensuse_hints() "texlive-zapfding", ); - check_rpm_missing(\@suse_tex_pkgs, 1) if ($pdf); - check_missing_tex(1) if ($pdf); + check_rpm_missing(\@suse_tex_pkgs, 2) if ($pdf); + check_missing_tex(2) if ($pdf); check_missing(\%map); return if (!$need && !$optional); @@ -443,7 +472,7 @@ sub give_mageia_hints() "texlive-fontsextra", ); - check_rpm_missing(\@tex_pkgs, 1) if ($pdf); + check_rpm_missing(\@tex_pkgs, 2) if ($pdf); check_missing(\%map); return if (!$need && !$optional); @@ -466,7 +495,8 @@ sub give_arch_linux_hints() "texlive-latexextra", "ttf-dejavu", ); - check_pacman_missing(\@archlinux_tex_pkgs, 1) if ($pdf); + check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf); + check_missing(\%map); return if (!$need && !$optional); @@ -485,7 +515,7 @@ sub give_gentoo_hints() ); check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf", - "media-fonts/dejavu", 1) if ($pdf); + "media-fonts/dejavu", 2) if ($pdf); check_missing(\%map); @@ -553,7 +583,7 @@ sub check_distros() my %map = ( "sphinx-build" => "sphinx" ); - check_missing_tex(1) if ($pdf); + check_missing_tex(2) if ($pdf); check_missing(\%map); print "I don't know distro $system_release.\n"; print "So, I can't provide you a hint with the install procedure.\n"; @@ -591,11 +621,13 @@ sub check_needs() check_program("make", 0); check_program("gcc", 0); check_python_module("sphinx_rtd_theme", 1) if (!$virtualenv); - check_program("xelatex", 1) if ($pdf); check_program("dot", 1); check_program("convert", 1); - check_program("rsvg-convert", 1) if ($pdf); - check_program("latexmk", 1) if ($pdf); + + # Extra PDF files - should use 2 for is_optional + check_program("xelatex", 2) if ($pdf); + check_program("rsvg-convert", 2) if ($pdf); + check_program("latexmk", 2) if ($pdf); check_distros(); -- 2.20.1