~ubuntu-branches/ubuntu/wily/octave/wily

« back to all changes in this revision

Viewing changes to scripts/mkdoc

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-05-14 12:42:41 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20130514124241-dqow8bc0l4r3yj93
Tags: 3.6.4-2
* Adapt for Texinfo 5
  - add_info_dir_categories: use @dircategory in the patch
  - texinfo5.diff: new patch, fixes compatibility issues with Texinfo 5
* Upgrade to FLTK 1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
#
3
 
# Copyright (C) 1999-2012 John W. Eaton
4
 
#
5
 
# This file is part of Octave.
6
 
#
7
 
# Octave is free software; you can redistribute it and/or modify it
8
 
# under the terms of the GNU General Public License as published by the
9
 
# Free Software Foundation; either version 3 of the License, or (at
10
 
# your option) any later version.
11
 
#
12
 
# Octave is distributed in the hope that it will be useful, but WITHOUT
13
 
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
 
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15
 
# for more details.
16
 
#
17
 
# You should have received a copy of the GNU General Public License
18
 
# along with Octave; see the file COPYING.  If not, see
19
 
# <http://www.gnu.org/licenses/>.
20
 
 
21
 
## Expecting arguments in this order:
22
 
##
23
 
##  SRCDIR SRCDIR-FILES ... -- LOCAL-FILES ...
24
 
 
25
 
set -e
26
 
 
27
 
PERL=${PERL:-'perl'}
28
 
 
29
 
prefix="$1/"
30
 
shift
31
 
 
32
 
if test -f gethelp; then
33
 
  cat << EOF
34
 
### DO NOT EDIT!
35
 
###
36
 
### This file is generated automatically from the Octave sources.
37
 
### Edit those files instead and run make to update this file.
38
 
 
39
 
EOF
40
 
  for arg
41
 
  do
42
 
    if [ "$arg" = "--" ]; then
43
 
      prefix="./"
44
 
    else
45
 
      $PERL -w -e '
46
 
        unless (@ARGV == 2) { die "Usage: $0 srcdir m_filename" ; }
47
 
        ($srcdir, $m_fname) = ($ARGV[0], $ARGV[1]);
48
 
        $full_fname = $srcdir . $m_fname;
49
 
        exit unless ( $full_fname =~ m{(.*)/(@|)([^/]*)/(.*)\.m} );
50
 
        if ($2) {
51
 
          $fcn = "$2$3/$4";
52
 
        } else {
53
 
          $fcn = $4;
54
 
        }
55
 
        $re_srcdir = quotemeta($srcdir);
56
 
        for (qx{ ./gethelp $fcn "$full_fname" < "$full_fname"} ) {
57
 
          s/^\s+\@/\@/ unless $in_example;
58
 
          s/^\s+\@group/\@group/;
59
 
          s/^\s+\@end\s+group/\@end group/;
60
 
          s|\@c $fcn $re_srcdir|\@c $fcn scripts/|o;
61
 
          $in_example = (/\s*\@example\b/ .. /\s*\@end\s+example\b/);
62
 
          print;
63
 
        }' "$prefix" "$arg"
64
 
    fi
65
 
  done
66
 
else
67
 
  echo "gethelp program seems to be missing!" 1>&2
68
 
  exit 1
69
 
fi