diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-13 08:19:44 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-17 06:57:52 -0300 |
commit | 4ea96d57bbfda93ae6cfdc8e565a3c419a78f328 (patch) | |
tree | 4cdca33f4422ab00c9b322fd7e75b812bb972dc1 /scripts/sphinx-pre-install | |
parent | 353290a9eb5362a80bc8e52fcd7eb77a30f48afc (diff) | |
download | linux-4ea96d57bbfda93ae6cfdc8e565a3c419a78f328.tar.gz linux-4ea96d57bbfda93ae6cfdc8e565a3c419a78f328.tar.bz2 linux-4ea96d57bbfda93ae6cfdc8e565a3c419a78f328.zip |
scripts/sphinx-pre-install: cleanup Gentoo checks
On Gentoo, the portage changes for ImageMagick to work are
always suggested, even if already applied. While the two
extra commands should be harmless, add a check to avoid
reporting it without need.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'scripts/sphinx-pre-install')
-rwxr-xr-x | scripts/sphinx-pre-install | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index 8dc13fe95ffe..0a5c83aa5f44 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -533,8 +533,19 @@ sub give_gentoo_hints() return if (!$need && !$optional); printf("You should run:\n\n"); - printf("\tsudo su -c 'echo \"media-gfx/imagemagick svg png\" > /etc/portage/package.use/imagemagick'\n"); - printf("\tsudo su -c 'echo \"media-gfx/graphviz cairo pdf\" > /etc/portage/package.use/graphviz'\n"); + + my $imagemagick = "media-gfx/imagemagick svg png"; + my $cairo = "media-gfx/graphviz cairo pdf"; + my $portage_imagemagick = "/etc/portage/package.use/imagemagick"; + my $portage_cairo = "/etc/portage/package.use/graphviz"; + + if (qx(cat $portage_imagemagick) ne "$imagemagick\n") { + printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n") + } + if (qx(cat $portage_cairo) ne "$cairo\n") { + printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n"); + } + printf("\tsudo emerge --ask $install\n"); } |