Mercurial > hg > octave-nkf
annotate scripts/help/__gripe_missing_component__.m @ 18015:fe59ef0084a6
maint: Periodic merge of stable to default.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 25 Nov 2013 22:25:35 -0800 |
parents | 21656a949661 |
children | 0f9c5a15c8fa |
rev | line source |
---|---|
17516
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
1 ## Copyright (C) 2013 Mike Miller |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
2 ## |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
4 ## |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
8 ## your option) any later version. |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
9 ## |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
13 ## General Public License for more details. |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
14 ## |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
18 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
20 ## @deftypefn {Function File} __gripe_missing_component__ (@var{caller}, @var{component}) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
21 ## Undocumented internal function. |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
22 ## @end deftypefn |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
23 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
24 function __gripe_missing_component__ (caller, component) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
25 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
26 if (nargin != 2) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
27 print_usage (); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
28 endif |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
29 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
30 msg = ""; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
31 fcn = missing_component_hook (); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
32 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
33 ftype = exist (fcn); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
34 if (ftype == 2 || ftype == 3 || ftype == 5 || ftype == 103) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
35 msg = feval (fcn, component); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
36 endif |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
37 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
38 if (isempty (msg)) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
39 switch (component) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
40 case "info-file" |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
41 msg = "unable to find the Octave info manual, Octave installation is incomplete"; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
42 case "mkoctfile" |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
43 msg = "unable to find the mkoctfile command, Octave installation is incomplete"; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
44 case "octave" |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
45 msg = "unable to find the octave executable, Octave installation is incomplete"; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
46 case "octave-config" |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
47 msg = "unable to find the octave-config command, Octave installation is incomplete"; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
48 otherwise |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
49 msg = ["unable to find required Octave component \"" component "\""]; |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
50 endswitch |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
51 endif |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
52 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
53 error ("%s: %s\n", caller, msg); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
54 |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
55 endfunction |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
diff
changeset
|
56 |