History

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

Jeremy MAURO committed 7 years ago

Commit ff8fdb31 parent bdd68861 file · +11 −9Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/sphinx-pre-install+11−9
@@ -124,11 +124,13 @@ sub add_package($$) · 123 unmodified lines
124 124
125sub check_missing_file($$$)125sub check_missing_file($$$)
126{126{
127 my $file = shift;127 my $files = shift;
128 my $package = shift;128 my $package = shift;
129 my $is_optional = shift;129 my $is_optional = shift;
130 130
131 return if(-e $file);131 for (@$files) {
132 return if(-e $_);
133 }
132 134
133 add_package($package, $is_optional);135 add_package($package, $is_optional);
134}136}
@@ -343,10 +345,10 @@ sub give_debian_hints() · 208 unmodified lines
343 );345 );
344 346
345 if ($pdf) {347 if ($pdf) {
346 check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",348 check_missing_file(["/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"],
347 "fonts-dejavu", 2);349 "fonts-dejavu", 2);
348 350
349 check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",351 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
350 "fonts-noto-cjk", 2);352 "fonts-noto-cjk", 2);
351 }353 }
352 354
@@ -413,7 +415,7 @@ sub give_redhat_hints() · 60 unmodified lines
413 }415 }
414 416
415 if ($pdf) {417 if ($pdf) {
416 check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",418 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
417 "google-noto-sans-cjk-ttc-fonts", 2);419 "google-noto-sans-cjk-ttc-fonts", 2);
418 }420 }
419 421
@@ -498,7 +500,7 @@ sub give_mageia_hints() · 78 unmodified lines
498 $map{"latexmk"} = "texlive-collection-basic";500 $map{"latexmk"} = "texlive-collection-basic";
499 501
500 if ($pdf) {502 if ($pdf) {
501 check_missing_file("/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",503 check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
502 "google-noto-sans-cjk-ttc-fonts", 2);504 "google-noto-sans-cjk-ttc-fonts", 2);
503 }505 }
504 506
@@ -528,7 +530,7 @@ sub give_arch_linux_hints() · 23 unmodified lines
528 check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf);530 check_pacman_missing(\@archlinux_tex_pkgs, 2) if ($pdf);
529 531
530 if ($pdf) {532 if ($pdf) {
531 check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc",533 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJK-Regular.ttc"],
532 "noto-fonts-cjk", 2);534 "noto-fonts-cjk", 2);
533 }535 }
534 536
@@ -549,11 +551,11 @@ sub give_gentoo_hints() · 14 unmodified lines
549 "rsvg-convert" => "gnome-base/librsvg",551 "rsvg-convert" => "gnome-base/librsvg",
550 );552 );
551 553
552 check_missing_file("/usr/share/fonts/dejavu/DejaVuSans.ttf",554 check_missing_file(["/usr/share/fonts/dejavu/DejaVuSans.ttf"],
553 "media-fonts/dejavu", 2) if ($pdf);555 "media-fonts/dejavu", 2) if ($pdf);
554 556
555 if ($pdf) {557 if ($pdf) {
556 check_missing_file("/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf",558 check_missing_file(["/usr/share/fonts/noto-cjk/NotoSansCJKsc-Regular.otf"],
557 "media-fonts/noto-cjk", 2);559 "media-fonts/noto-cjk", 2);
558 }560 }
559 561