File: 50_control-output-of-whos.dpatch

package info (click to toggle)
inline-octave 0.21-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 120 kB
  • ctags: 67
  • sloc: perl: 809; makefile: 44; sh: 24
file content (34 lines) | stat: -rw-r--r-- 1,004 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_control-output-of-whos.dpatch by  <rafael@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Force output format of whos command

@DPATCH@

--- inline-octave-0.21.orig/Octave.pm
+++ inline-octave-0.21/Octave.pm
@@ -129,7 +129,7 @@
   my $switches= "-qfH";
   my $octave_interpreter_bin;
 
-  $octave_interpreter_bin= 'octave' # _EDITLINE_MARKER_
+  $octave_interpreter_bin= 'octave2.1' # _EDITLINE_MARKER_
      unless $octave_object->{INTERP};
 
   $octave_interpreter_bin = $ENV{PERL_INLINE_OCTAVE_BIN}
@@ -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;