scripts: sphinx-pre-install: add support for OpenMandriva
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Apr 2020 16:56:12 +0000 (18:56 +0200)
committerJonathan Corbet <corbet@lwn.net>
Mon, 20 Apr 2020 21:19:13 +0000 (15:19 -0600)
It seems that Mageia and OpenMandriva will reunite on a single
distribution. In any case, both came from Mandriva. So, it is
close enough to use the same logic.

So, add support for it.

Tested with OpenMandriva 4.1 and with Mageia 7.1.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Link: https://lore.kernel.org/r/692809729c6818a0b0f75513da15970c53d5565c.1586883286.git.mchehab+huawei@kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
scripts/sphinx-pre-install

index 86e14b9..89b0332 100755 (executable)
@@ -494,7 +494,7 @@ sub give_mageia_hints()
                "convert"               => "ImageMagick",
                "Pod::Usage"            => "perl-Pod-Usage",
                "xelatex"               => "texlive",
-               "rsvg-convert"          => "librsvg2-tools",
+               "rsvg-convert"          => "librsvg2",
        );
 
        my @tex_pkgs = (
@@ -503,16 +503,29 @@ sub give_mageia_hints()
 
        $map{"latexmk"} = "texlive-collection-basic";
 
+       my $packager_cmd;
+       my $noto_sans;
+       if ($system_release =~ /OpenMandriva/) {
+               $packager_cmd = "dnf install";
+               $noto_sans = "noto-sans-cjk-fonts";
+               @tex_pkgs = ( "texlive-collection-fontsextra" );
+       } else {
+               $packager_cmd = "urpmi";
+               $noto_sans = "google-noto-sans-cjk-ttc-fonts";
+       }
+
+
        if ($pdf) {
-               check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc"],
-                                  "google-noto-sans-cjk-ttc-fonts", 2);
+               check_missing_file(["/usr/share/fonts/google-noto-cjk/NotoSansCJK-Regular.ttc",
+                                   "/usr/share/fonts/TTF/NotoSans-Regular.ttf"],
+                                  $noto_sans, 2);
        }
 
        check_rpm_missing(\@tex_pkgs, 2) if ($pdf);
        check_missing(\%map);
 
        return if (!$need && !$optional);
-       printf("You should run:\n\n\tsudo urpmi $install\n");
+       printf("You should run:\n\n\tsudo $packager_cmd $install\n");
 }
 
 sub give_arch_linux_hints()
@@ -626,6 +639,10 @@ sub check_distros()
                give_mageia_hints;
                return;
        }
+       if ($system_release =~ /OpenMandriva/) {
+               give_mageia_hints;
+               return;
+       }
        if ($system_release =~ /Arch Linux/) {
                give_arch_linux_hints;
                return;