# HG changeset patch # User Rik # Date 1435545764 25200 # Node ID 13ede127ec9aa80b744aeb2a08fc9990a5eba6bf # Parent 494a5ed628b5baad2fbac27a5084d2444d77d3d1 graphics_toolkit.m: Check for minimum gnuplot version (bug #44978). * graphics_toolkit.m: Special exception checking for gnuplot version before switching toolkit. Call __gnuplot_has_feature__ with feature "minimum_version". * __gnuplot_has_feature__.m: Add new feature "minimum_version" with value >= 4.2.5. diff -r 494a5ed628b5 -r 13ede127ec9a scripts/plot/util/graphics_toolkit.m --- a/scripts/plot/util/graphics_toolkit.m Fri Jun 26 08:37:45 2015 -0700 +++ b/scripts/plot/util/graphics_toolkit.m Sun Jun 28 19:42:44 2015 -0700 @@ -82,6 +82,14 @@ endif if (! any (strcmp (loaded_graphics_toolkits (), name))) + ## FIXME: Special gnuplot handling for versions < 4.2.5 (bug #44978). + ## This can probably be deleted in the future once RHEL upgrades gnuplot. + if (strcmp (name, "gnuplot")) + valid_version = __gnuplot_has_feature__ ("minimum_version"); + if (valid_version != 1) + error ("graphics_toolkit: gnuplot version to old."); + endif + endif feval (["__init_", name, "__"]); if (! any (strcmp (loaded_graphics_toolkits (), name))) error ("graphics_toolkit: %s toolkit was not correctly loaded", name); diff -r 494a5ed628b5 -r 13ede127ec9a scripts/plot/util/private/__gnuplot_has_feature__.m --- a/scripts/plot/util/private/__gnuplot_has_feature__.m Fri Jun 26 08:37:45 2015 -0700 +++ b/scripts/plot/util/private/__gnuplot_has_feature__.m Sun Jun 28 19:42:44 2015 -0700 @@ -25,7 +25,8 @@ ## Created: 2009-01-27 function res = __gnuplot_has_feature__ (feature) - persistent features = {"x11_figure_position", + persistent features = {"minimum_version", + "x11_figure_position", "wxt_figure_size", "transparent_patches", "transparent_surface", @@ -45,8 +46,8 @@ ## Don't throw an error if gnuplot isn't installed gnuplot_version = "0.0.0"; end_try_catch - versions = {"4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3"}; - operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; + versions = {"4.2.5", "4.2.5", "4.4", "4.4", "4.4", "4.2", "4.2", "4.4", "4.4", "4.4", "4.4", "4.3"}; + operators = {">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">=", ">="}; have_features = false (size (features)); for n = 1 : numel (have_features) has_features(n) = compare_versions (gnuplot_version, versions{n}, operators{n});