mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
scripts/sphinx-pre-install: allow checking for multiple missing files
The current implementation take a simple file as first argument, this change allows to take a list as a first argument. Some file could have a different path according distribution version Signed-off-by: Jeremy MAURO <j.mauro@criteo.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
bdd68860a0
commit
ff8fdb36ac
1 changed files with 11 additions and 9 deletions
|
@ -124,11 +124,13 @@ sub add_package($$)
|
||||||
|
|
||||||
sub check_missing_file($$$)
|
sub check_missing_file($$$)
|
||||||
{
|
{
|
||||||
my $file = shift;
|
my $files = shift;
|
||||||
my $package = shift;
|
my $package = shift;
|
||||||
my $is_optional = shift;
|
my $is_optional = shift;
|
||||||
|
|
||||||
return if(-e $file);
|
for (@$files) {
|
||||||
|
return if(-e $_);
|
||||||
|
}
|
||||||
|
|
||||||
add_package($package, $is_optional);
|
add_package($package, $is_optional);
|
||||||
}
|
}
|
||||||
|
@ -343,10 +345,10 @@ sub give_debian_hints()
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
|
check_missing_file(["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"],
|
||||||
"fonts-dejavu", 2);
|
"fonts-dejavu", 2);
|
||||||
|
|
||||||
check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
|
check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
|
||||||
"fonts-noto-cjk", 2);
|
"fonts-noto-cjk", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,7 +415,7 @@ sub give_redhat_hints()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
|
check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
|
||||||
"google-noto-sans-cjk-ttc-fonts", 2);
|
"google-noto-sans-cjk-ttc-fonts", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -498,7 +500,7 @@ sub give_mageia_hints()
|
||||||
$map{"latexmk"} = "texlive-collection-basic";
|
$map{"latexmk"} = "texlive-collection-basic";
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
|
check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
|
||||||
"google-noto-sans-cjk-ttc-fonts", 2);
|
"google-noto-sans-cjk-ttc-fonts", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +530,7 @@ sub give_arch_linux_hints()
|
||||||
check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf);
|
check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf);
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",
|
check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
|
||||||
"noto-fonts-cjk", 2);
|
"noto-fonts-cjk", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,11 +551,11 @@ sub give_gentoo_hints()
|
||||||
"rsvg-convert" => "gnome-base/librsvg",
|
"rsvg-convert" => "gnome-base/librsvg",
|
||||||
);
|
);
|
||||||
|
|
||||||
check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf",
|
check_missing_file(["/usr/share/fonts/dejavu/DejaVuSans.ttf"],
|
||||||
"media-fonts/dejavu", 2) if ($pdf);
|
"media-fonts/dejavu", 2) if ($pdf);
|
||||||
|
|
||||||
if ($pdf) {
|
if ($pdf) {
|
||||||
check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",
|
check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf"],
|
||||||
"media-fonts/noto-cjk", 2);
|
"media-fonts/noto-cjk", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue