History

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.

Mauro Carvalho Chehab committed 7 years ago

Commit 4ea96d51 parent 353290a1 file · +13 −2Browse files

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

Unified · Split

scripts/sphinx-pre-install+13−2
@@ -533,8 +533,19 @@ sub give_gentoo_hints() · 532 unmodified lines
533533 return if (!$need && !$optional);
534534
535535 printf("You should run:\n\n");
536− printf("\tsudo su -c 'echo \"media-gfx/imagemagick svg png\" > /etc/portage/package.use/imagemagick'\n");
537− printf("\tsudo su -c 'echo \"media-gfx/graphviz cairo pdf\" > /etc/portage/package.use/graphviz'\n");
536+
537+ my $imagemagick = "media-gfx/imagemagick svg png";
538+ my $cairo = "media-gfx/graphviz cairo pdf";
539+ my $portage_imagemagick = "/etc/portage/package.use/imagemagick";
540+ my $portage_cairo = "/etc/portage/package.use/graphviz";
541+
542+ if (qx(cat $portage_imagemagick) ne "$imagemagick\n") {
543+ printf("\tsudo su -c 'echo \"$imagemagick\" > $portage_imagemagick'\n")
544+ }
545+ if (qx(cat $portage_cairo) ne "$cairo\n") {
546+ printf("\tsudo su -c 'echo \"$cairo\" > $portage_cairo'\n");
547+ }
548+
538549 printf("\tsudo emerge --ask $install\n");
539550
540551 }