[Pkg-octave-devel] Patch for Inline::Octave to work with Octave 2.1.64

Rafael Laboissiere Rafael Laboissiere <rafael@debian.org>
Fri, 11 Feb 2005 23:48:46 +0100


--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Andy,

I recently uploaded a new libinline-octave-perl package for Debian based on
your Inline::Octave module and I needed to patch Octave.pm in order to have
it working with Octave 2.1.64.  You will find the patch attached below.

The problem arose because Octave.pm made assumptions about the output format
of the command "whos -function", which apparentely changes from one version
to another.  I worked around the problem by explicitly setting the variable
whos_line_format.  I do not know if it would work with versions of Octave
previous to 2.1.64.

-- 
Rafael

--5mCyUwZo2JvN/JJP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="50_control-output-of-whos.dpatch"

--- inline-octave-0.21.orig/Octave.pm
+++ inline-octave-0.21/Octave.pm
@@ -430,11 +430,12 @@
 sub get_defined_functions
 {
    my $o = shift;
+   $o->interpret('whos_line_format ="%ln:50;%rt:50;\n";');
    my $data= $o->interpret("whos('-functions')");
    my @funclist;
-   while ( $data =~ /user(-defined|) function +- +- +(\w+)/g )
+   while ( $data =~ /(\w+)\s+user(-defined|) function/g )
    {
-      push @funclist, $2;
+      push @funclist, $1;
    }
    return @funclist;
 

--5mCyUwZo2JvN/JJP--