stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 5.2 10/76] scripts/sphinx-pre-install: don't use LaTeX with CentOS 7
Date: Fri,  2 Aug 2019 09:18:44 -0400	[thread overview]
Message-ID: <20190802131951.11600-10-sashal@kernel.org> (raw)
In-Reply-To: <20190802131951.11600-1-sashal@kernel.org>

From: Mauro Carvalho Chehab <mchehab+samsung@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 <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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


  parent reply	other threads:[~2019-08-02 13:36 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-02 13:18 [PATCH AUTOSEL 5.2 01/76] powerpc: fix off by one in max_zone_pfn initialization for ZONE_DMA Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 02/76] netfilter: nfnetlink: avoid deadlock due to synchronous request_module Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 03/76] vfio-ccw: Set pa_nr to 0 if memory allocation fails for pa_iova_pfn Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 04/76] vfio-ccw: Don't call cp_free if we are processing a channel program Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 05/76] netfilter: Fix rpfilter dropping vrf packets by mistake Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 06/76] netfilter: nf_tables: fix module autoload for redir Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 07/76] netfilter: conntrack: always store window size un-scaled Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 08/76] netfilter: nft_hash: fix symhash with modulus one Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 09/76] scripts/sphinx-pre-install: fix script for RHEL/CentOS Sasha Levin
2019-08-02 13:18 ` Sasha Levin [this message]
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 11/76] scripts/sphinx-pre-install: fix latexmk dependencies Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 12/76] rq-qos: don't reset has_sleepers on spurious wakeups Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 13/76] rq-qos: set ourself TASK_UNINTERRUPTIBLE after we schedule Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 14/76] rq-qos: use a mb for got_token Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 15/76] netfilter: nf_tables: Support auto-loading for inet nat Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 16/76] drm/amd/display: No audio endpoint for Dell MST display Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 17/76] drm/amd/display: Clock does not lower in Updateplanes Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 18/76] drm/amd/display: Wait for backlight programming completion in set backlight level Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 19/76] drm/amd/display: fix DMCU hang when going into Modern Standby Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 20/76] drm/amd/display: use encoder's engine id to find matched free audio device Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 21/76] drm/amd/display: put back front end initialization sequence Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 22/76] drm/amd/display: allocate 4 ddc engines for RV2 Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 23/76] drm/amd/display: Fix dc_create failure handling and 666 color depths Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 24/76] drm/amd/display: Only enable audio if speaker allocation exists Sasha Levin
2019-08-02 13:18 ` [PATCH AUTOSEL 5.2 25/76] drm/amd/display: Increase size of audios array Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 26/76] iscsi_ibft: make ISCSI_IBFT dependson ACPI instead of ISCSI_IBFT_FIND Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 27/76] nl80211: fix NL80211_HE_MAX_CAPABILITY_LEN Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 28/76] mac80211: fix possible memory leak in ieee80211_assign_beacon Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 29/76] mac80211: don't warn about CW params when not using them Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 30/76] allocate_flower_entry: should check for null deref Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 31/76] hwmon: (occ) Fix division by zero issue Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 32/76] hwmon: (nct6775) Fix register address and added missed tolerance for nct6106 Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 33/76] ARM: dts: imx6ul: fix clock frequency property name of I2C buses Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 34/76] x86/mm: Check for pfn instead of page in vmalloc_sync_one() Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 35/76] x86/mm: Sync also unmappings in vmalloc_sync_all() Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 36/76] mm/vmalloc: Sync unmappings in __purge_vmap_area_lazy() Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 37/76] powerpc/papr_scm: Force a scm-unbind if initial scm-bind fails Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 38/76] arm64: Force SSBS on context switch Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 39/76] arm64: entry: SP Alignment Fault doesn't write to FAR_EL1 Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 40/76] iommu/vt-d: Check if domain->pgd was allocated Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 41/76] drm/msm/dpu: Correct dpu encoder spinlock initialization Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 42/76] drm/msm: stop abusing dma_map/unmap for cache Sasha Levin
2019-08-03  0:14   ` Rob Clark
2019-08-14  2:03     ` Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 43/76] drm: silence variable 'conn' set but not used Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 44/76] arm64: dts: imx8mm: Correct SAI3 RXC/TXFS pin's mux option #1 Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 45/76] arm64: dts: imx8mq: fix SAI compatible Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 46/76] cpufreq/pasemi: fix use-after-free in pas_cpufreq_cpu_init() Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 47/76] s390/qdio: add sanity checks to the fast-requeue path Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 48/76] ALSA: compress: Fix regression on compressed capture streams Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 49/76] ALSA: compress: Prevent bypasses of set_params Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 50/76] ALSA: compress: Don't allow paritial drain operations on capture streams Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 51/76] ALSA: compress: Be more restrictive about when a drain is allowed Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 52/76] perf script: Fix off by one in brstackinsn IPC computation Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 53/76] perf tools: Fix proper buffer size for feature processing Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 54/76] perf stat: Fix segfault for event group in repeat mode Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 55/76] perf session: Fix loading of compressed data split across adjacent records Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 56/76] perf probe: Avoid calling freeing routine multiple times for same pointer Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 57/76] drbd: dynamically allocate shash descriptor Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 58/76] ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id() Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 59/76] nvme: ignore subnqn for ADATA SX6000LNP Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 60/76] nvme: fix memory leak caused by incorrect subsystem free Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 61/76] nvme: fix multipath crash when ANA is deactivated Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 62/76] ARM: davinci: fix sleep.S build error on ARMv4 Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 63/76] ARM: dts: bcm: bcm47094: add missing #cells for mdio-bus-mux Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 64/76] scsi: megaraid_sas: fix panic on loading firmware crashdump Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 65/76] scsi: ibmvfc: fix WARN_ON during event pool release Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 66/76] scsi: scsi_dh_alua: always use a 2 second delay before retrying RTPG Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 67/76] test_firmware: fix a memory leak bug Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 68/76] sched/fair: Don't free p->numa_faults with concurrent readers Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 69/76] sched/fair: Use RCU accessors consistently for ->numa_group Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 70/76] tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 71/76] perf/x86/intel: Fix SLOTS PEBS event constraint Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 72/76] perf/x86/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x register Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 73/76] perf/x86: Apply more accurate check on hypervisor platform Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 74/76] perf/core: Fix creating kernel counters for PMUs that override event->cpu Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 75/76] s390/dma: provide proper ARCH_ZONE_DMA_BITS value Sasha Levin
2019-08-02 13:19 ` [PATCH AUTOSEL 5.2 76/76] gen_compile_commands: lower the entry count threshold Sasha Levin

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=20190802131951.11600-10-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).