changeset 12460:952e52dda82e

Improve warnings when shell utilties needed for printing are missing.
author Ben Abbott <bpabbott@mac.com>
date Sat, 19 Feb 2011 15:01:59 -0500
parents b3f9f98e7640
children cc14943e6254
files scripts/ChangeLog scripts/plot/__print_parse_opts__.m scripts/plot/private/__ghostscript__.m
diffstat 3 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-19  Ben Abbott  <bpabbott@mac.com>
+
+	* plot/__print_parse_opts__.m, plot/private/__ghostscript__.m: Improve
+	warnings when shell utilties are missing.
+
 2011-02-19  Thorsten Meyer  <thorsten.meyier@gmx.de>
 
 	* general/interp1.m: Fix tests according to spline update of
--- a/scripts/plot/__print_parse_opts__.m
+++ b/scripts/plot/__print_parse_opts__.m
@@ -344,16 +344,17 @@
 
   if (warn_on_missing_binary)
     if (isempty (arg_st.ghostscript.binary))
-      warning ("print:missinggs", "print.m: Ghostscript binary is not available");
-    endif
-    if (isempty (arg_st.epstool_binary))
-      warning ("print:missinggs", "print.m: epstool binary is not available");
-    endif
-    if (isempty (arg_st.fig2dev_binary))
-      warning ("print:missinggs", "print.m: fig2dev binary is not available");
-    endif
-    if (isempty (arg_st.pstoedit_binary))
-      warning ("print:missinggs", "print.m: pstoedit binary is not available");
+      warning ("print:missing_gs", "print.m: Ghostscript binary is not available.\nOnly eps output is available.");
+    else
+      if (isempty (arg_st.epstool_binary))
+        warning ("print:missing_epstool", "print.m: epstool binary is not available.\nSome output formats are not available.");
+      endif
+      if (isempty (arg_st.fig2dev_binary))
+        warning ("print:missing_fig2dev", "print.m: fig2dev binary is not available.\nSome output formats are not available.");
+      endif
+      if (isempty (arg_st.pstoedit_binary))
+        warning ("print:missing_pstoedit", "print.m: pstoedit binary is not available.\nSome output formats are not available.");
+      endif
     endif
     warn_on_missing_binary = false;
   endif
--- a/scripts/plot/private/__ghostscript__.m
+++ b/scripts/plot/private/__ghostscript__.m
@@ -130,7 +130,9 @@
     endif
   endif
 
-  if (isempty (opts.output))
+  if (isempty (opts.binary))
+    error ("print:no_ghostscript", "__ghostscript__.m: ghostscript is required.");
+  elseif (isempty (opts.output))
     cmd = sprintf ("%s %s", opts.binary, gs_opts);
   else
     cmd = sprintf ("%s %s -sOutputFile=%s", opts.binary, gs_opts, opts.output);