annotate scripts/miscellaneous/news.m @ 16178:3a93af21d206

New function citation() to display citation information (patch #7960) * display_info_file.m: the new function is pretty much the same as news() so this new private function is their common code * citation.m: the new function * help.m: changed to use the private function with common code with citation() * CITATION: new file with citation instructions for Octave core * Makefile.am: add CITATION file into the build system and install into octetc * bootstrap.conf: make sure that the CITATION is present when installing * copy_files.m: make pkg() check and install CITATION files from packages * doc/interpreter/package.txi: document optional CITATION files for packages
author Carnë Draug <carandraug@octave.org>
date Sun, 03 Mar 2013 02:34:44 +0000
parents f3d52523cde1
children 1c89599167a6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 13865
diff changeset
1 ## Copyright (C) 2007-2012 John W. Eaton
6252
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
2 ##
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
4 ##
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6252
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6252
diff changeset
8 ## your option) any later version.
6252
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
9 ##
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
14 ##
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6252
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6252
diff changeset
17 ## <http://www.gnu.org/licenses/>.
6252
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
18
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
16178
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
20 ## @deftypefn {Command} {} news
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
21 ## @deftypefnx {Command} {} news @var{package}
14232
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
22 ## Display the current NEWS file for Octave or an installed package.
13863
b81e0b3fedab news: support to read news of installed packages
Carnë Draug <carandraug+dev@gmail.com>
parents: 12844
diff changeset
23 ##
14232
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
24 ## When called without an argument, display the NEWS file for Octave.
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
25 ## When given a package name @var{package}, display the current NEWS file for
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
26 ## that package.
6252
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
27 ## @end deftypefn
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
28
13865
5d928d37f159 news: fixing bug when package is not specified and core NEWS file can't be found
Carnë Draug <carandraug+dev@gmail.com>
parents: 13864
diff changeset
29 function news (package = "octave")
13863
b81e0b3fedab news: support to read news of installed packages
Carnë Draug <carandraug+dev@gmail.com>
parents: 12844
diff changeset
30
14232
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
31 if (nargin > 1)
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
32 print_usage ();
16178
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
33 else
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
34 display_info_file ("news", package, "NEWS");
14232
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
35 endif
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
36
6252
738c97e101eb [project @ 2007-01-24 19:58:46 by jwe]
jwe
parents:
diff changeset
37 endfunction
12844
e51ad94535b9 codesprint: Remove news.m from test statistics.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
38
14232
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
39
3e94663fc3e9 news.m: Revamp implementation of function.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
40 %!error news (1, 2)
16178
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
41 %!error <news: PACKAGE must be a string> news (1)
3a93af21d206 New function citation() to display citation information (patch #7960)
Carnë Draug <carandraug@octave.org>
parents: 14363
diff changeset
42 %!error <news: package .* is not installed> news ("__NOT_A_VALID_PKG_NAME__")