lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <baac156b1ccb74873f99fc0b5b0e5a19d83a0d84.1500653544.git.mchehab@s-opensource.com>
Date:   Fri, 21 Jul 2017 13:20:41 -0300
From:   Mauro Carvalho Chehab <mchehab@...pensource.com>
To:     Linux Doc Mailing List <linux-doc@...r.kernel.org>
Cc:     Mauro Carvalho Chehab <mchehab@...pensource.com>,
        Mauro Carvalho Chehab <mchehab@...radead.org>,
        linux-kernel@...r.kernel.org, Jonathan Corbet <corbet@....net>
Subject: [PATCH] sphinx-pre-install: add support for Mageia

Add support for detecting and installing missing packages
on Mageia. I opted to use "urpmi" at the install instructions,
as this is present on Mageia since ever. Yet, if I were using
Mageia 6, I would likely be using "dnf", as it is, IMHO,
easier to use.

Tested with Mageia 6.

Signed-off-by: Mauro Carvalho Chehab <mchehab@...pensource.com>
---

This patch comes after this series:
	[PATCH v2 0/8] Add a script to check for Sphinx install requirements

With that, IMHO, we're covering the major community-based desktop
distributions that Kernel developers use. 

Yet, it should be easy enough to use the examples there to add support for
more distros when needed, specially if they're derived from the ones there 
(like CentOS, RHEL, SUSE, etc).

 scripts/sphinx-pre-install | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
index 2d18064d57b4..5d2799dcfceb 100755
--- a/scripts/sphinx-pre-install
+++ b/scripts/sphinx-pre-install
@@ -212,7 +212,10 @@ sub check_sphinx()
 	}
 
 	if ($virtualenv) {
-		check_program("virtualenv", 0) if (!findprog("virtualenv-3"));
+		my $prog = findprog("virtualenv-3");
+		$prog = findprog("virtualenv-3.5") if (!$prog);
+
+		check_program("virtualenv", 0) if (!$prog);
 		check_program("pip", 0) if (!findprog("pip3"));
 		$need_sphinx = 1;
 	} else {
@@ -351,6 +354,33 @@ sub give_opensuse_hints()
 	printf("You should run:\n\n\tsudo zypper install --no-recommends $install\n");
 }
 
+sub give_mageia_hints()
+{
+	my %map = (
+		"python-sphinx"		=> "python3-sphinx",
+		"sphinx_rtd_theme"	=> "python3-sphinx_rtd_theme",
+		"virtualenv"		=> "python3-virtualenv",
+		"pip"			=> "python3-pip",
+		"dot"			=> "graphviz",
+		"convert"		=> "ImageMagick",
+		"Pod::Usage"		=> "perl-Pod-Usage",
+		"xelatex"		=> "texlive",
+		"rsvg-convert"		=> "librsvg2-tools",
+	);
+
+	my @tex_pkgs = (
+		"texlive-fontsextra",
+	);
+
+	my $release;
+
+	check_rpm_missing(\@tex_pkgs, 1) if ($pdf);
+	check_missing(\%map);
+
+	return if (!$need && !$optional);
+	printf("You should run:\n\n\tsudo urpmi $install\n");
+}
+
 sub give_arch_linux_hints()
 {
 	my %map = (
@@ -424,6 +454,10 @@ sub check_distros()
 		give_opensuse_hints;
 		return;
 	}
+	if ($system_release =~ /Mageia/) {
+		give_mageia_hints;
+		return;
+	}
 	if ($system_release =~ /Arch Linux/) {
 		give_arch_linux_hints;
 		return;
@@ -483,6 +517,7 @@ sub check_needs()
 			printf "\t. $activate\n";
 		} else {
 			my $virtualenv = findprog("virtualenv-3");
+			$virtualenv = findprog("virtualenv-3.5") if (!$virtualenv);
 			$virtualenv = findprog("virtualenv") if (!$virtualenv);
 			$virtualenv = "virtualenv" if (!$virtualenv);
 
-- 
2.13.3


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ