annotate scripts/pkg/pkg.m @ 31548:c8ad083a5802 stable

maint: Clean up m-files before Octave 8.1 release. * external.txi, oop.txi, Table.h, documentation.cc, gui-preferences-ed.h, lo-specfun.cc, range.tst : Eliminate triple newlines. * Map.m, MemoizedFunction.m, delaunayn.m, inputParser.m, __publish_latex_output__.m, publish.m, unpack.m, fminbnd.m, __add_default_menu__.m, gammainc.m, gallery.m, hadamard.m, weboptions.m: Add newline after keyword "function" or before keyword "endfunction" for readability. * getaudiodata.m, pkg.m : Add semicolon to end of line for error() statement. * movegui.m: Combine mutliple calls to set() into one for performance. * __unimplemented__.m (missing_functions): Remove missing functions that have been implemented. * __vectorize__.m, check_default_input.m, betaincinv.m, gammaincinv.m: Remove semicolon at end of line with "function" declaration. * weboptions.m: Remove semicolon at end of line with "if" keyword. * integrate_adaptive.m, factor.m: Use keyword "endif" rather than bare "end".
author Rik <rik@octave.org>
date Fri, 25 Nov 2022 21:23:54 -0800
parents 96f751f8392c
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 ##
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30419
diff changeset
3 ## Copyright (C) 2005-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27794
diff changeset
4 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11547
diff changeset
7 ##
6440
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
8 ## This file is part of Octave.
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
9 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
6440
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
11 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22529
diff changeset
13 ## (at your option) any later version.
6440
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
14 ##
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22529
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22529
diff changeset
18 ## GNU General Public License for more details.
6440
98ee80702bca [project @ 2007-03-23 15:13:19 by jwe]
jwe
parents: 6378
diff changeset
19 ##
5801
70013c9f3ccc [project @ 2006-05-10 16:53:03 by jwe]
jwe
parents:
diff changeset
20 ## 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: 6950
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
22 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ########################################################################
5801
70013c9f3ccc [project @ 2006-05-10 16:53:03 by jwe]
jwe
parents:
diff changeset
25
70013c9f3ccc [project @ 2006-05-10 16:53:03 by jwe]
jwe
parents:
diff changeset
26 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20727
diff changeset
27 ## @deftypefn {} {} pkg @var{command} @var{pkg_name}
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20727
diff changeset
28 ## @deftypefnx {} {} pkg @var{command} @var{option} @var{pkg_name}
22529
640c1b476860 pkg.m: more clearly document package querying options (bug #49156)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 22323
diff changeset
29 ## @deftypefnx {} {[@var{out1}, @dots{}] =} pkg (@var{command}, @dots{} )
640c1b476860 pkg.m: more clearly document package querying options (bug #49156)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 22323
diff changeset
30 ## Manage or query packages (groups of add-on functions) for Octave.
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
31 ##
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
32 ## Packages can be installed globally (i.e., for all users of the system) or
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
33 ## locally (i.e., for the current user only).
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
34 ##
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
35 ## Global packages are installed by default in a system-wide location. This is
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
36 ## usually a subdirectory of the folder where Octave itself is installed.
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
37 ## Therefore, Octave needs write access to this folder to install global
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
38 ## packages, which is usually only available when Octave is run with
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
39 ## administrative privileges, such as when run as root (or superuser) on
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
40 ## Unix-like systems, or run with elevated privileges ("Run as administrator")
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
41 ## on Windows.
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
42 ##
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
43 ## In contrast, local packages are installed by default in the user's home
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
44 ## directory (or user profile on Windows) and are only available to that
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
45 ## specific user. Usually, they can be installed without administrative
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
46 ## privileges.
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
47 ##
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
48 ## When Octave is running with administrative privileges, @code{pkg} will
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
49 ## install packages to the global package location by default. Otherwise,
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
50 ## packages will be installed to the local location by default. The user can
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
51 ## override this default installation location with optional arguments
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
52 ## (@option{-local} or @option{-global}) as described below. The currently
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
53 ## used default package installation location can be queried with
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
54 ## @code{pkg prefix}.
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
55 ##
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
56 ## For global and local packages, there are separate databases holding the
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
57 ## information about the installed packages. If some package is installed
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
58 ## globally as well as locally, the local installation takes precedence over
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
59 ## ("shadows") the global one. Which (global or local) package installation is
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
60 ## used can also be manipulated by using prefixes and/or using the
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
61 ## @samp{local_list} input argument. Using these mechanisms, several different
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
62 ## releases of the same package can be installed side by side as well (but
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
63 ## cannot be loaded simultaneously).
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
64 ##
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
65 ## Packages might depend on external software and/or other packages. To be
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
66 ## able to install such packages, these dependencies should be installed
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
67 ## beforehand. A package that depends on other package(s) can still be
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
68 ## installed using the @option{-nodeps} flag. The effects of unsatisfied
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
69 ## dependencies on external software---like libraries---depends on the
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
70 ## individual package.
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
71 ##
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
72 ## Packages must be loaded before they can be used. When loading a package,
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
73 ## Octave performs the following tasks:
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
74 ## @enumerate
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
75 ## @item
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
76 ## If the package depends on other packages (and @code{pkg load} is called
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
77 ## without the @option{-nodeps} option), the package is not loaded
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
78 ## immediately. Instead, those dependencies are loaded first (recursively if
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
79 ## needed).
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
80 ##
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
81 ## @item
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
82 ## When all dependencies are satisfied, the package's subdirectories are
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
83 ## added to the search path.
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
84 ## @end enumerate
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
85 ##
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
86 ## This load order leads to functions that are provided by dependencies being
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
87 ## potentially shadowed by functions of the same name that are provided by
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
88 ## top-level packages.
28343
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
89 ##
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
90 ## Each time, a package is added to the search path, initialization script(s)
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
91 ## for the package are automatically executed if they are provided by the
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
92 ## package.
8b71a6cec9bf pkg.m: Add introduction to packages to doc string (bug #58225).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28278
diff changeset
93 ##
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
94 ## Depending on the value of @var{command} and on the number of requested
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
95 ## return arguments, @code{pkg} can be used to perform several tasks.
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
96 ## Possible values for @var{command} are:
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
97 ##
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
98 ## @table @samp
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
99 ##
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
100 ## @item install
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
101 ## Install named packages. For example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
102 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
103 ## @example
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
104 ## pkg install image-1.0.0.tar.gz
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
105 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
106 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
107 ## @noindent
24934
1db0b81efafe maint: strip trailing whitespace from source files
Mike Miller <mtmiller@octave.org>
parents: 24877
diff changeset
108 ## installs the package found in the file @file{image-1.0.0.tar.gz}. The
27574
c89a6f3eab69 pkg.m: Use uppercase URL in documentation and error messages.
Rik <rik@octave.org>
parents: 27573
diff changeset
109 ## file containing the package can be a URL, e.g.,
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
110 ##
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
111 ## @example
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
112 ## pkg install 'http://somewebsite.org/image-1.0.0.tar.gz'
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
113 ## @end example
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
114 ##
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
115 ## @noindent
27794
45ad2127582b doc: grammarcheck scripts before 6.1 release.
Rik <rik@octave.org>
parents: 27707
diff changeset
116 ## installs the package found in the given URL@. This
24934
1db0b81efafe maint: strip trailing whitespace from source files
Mike Miller <mtmiller@octave.org>
parents: 24877
diff changeset
117 ## requires an internet connection and the cURL library.
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
118 ##
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
119 ## @noindent
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
120 ## @emph{Security risk}: no verification of the package is performed
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
121 ## before the installation. It has the same security issues as manually
27574
c89a6f3eab69 pkg.m: Use uppercase URL in documentation and error messages.
Rik <rik@octave.org>
parents: 27573
diff changeset
122 ## downloading the package from the given URL and installing it.
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
123 ##
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
124 ## @noindent
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
125 ## @emph{No support}: the GNU Octave community is not responsible for
24934
1db0b81efafe maint: strip trailing whitespace from source files
Mike Miller <mtmiller@octave.org>
parents: 24877
diff changeset
126 ## packages installed from foreign sites. For support or for
1db0b81efafe maint: strip trailing whitespace from source files
Mike Miller <mtmiller@octave.org>
parents: 24877
diff changeset
127 ## reporting bugs you need to contact the maintainers of the installed
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
128 ## package directly (see the @file{DESCRIPTION} file of the package)
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
129 ##
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
130 ## The @var{option} variable can contain options that affect the manner
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
131 ## in which a package is installed. These options can be one or more of
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
132 ##
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
133 ## @table @code
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
134 ## @item -nodeps
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
135 ## The package manager will disable dependency checking. With this option it
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
136 ## is possible to install a package even when it depends on another package
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
137 ## which is not installed on the system. @strong{Use this option with care.}
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
138 ##
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
139 ## @item -local
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 12931
diff changeset
140 ## A local installation (package available only to current user) is forced,
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
141 ## even if Octave is being run with administrative privileges.
6258
ea3a7e8469e9 [project @ 2007-01-30 20:17:19 by dbateman]
dbateman
parents: 6254
diff changeset
142 ##
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
143 ## @item -global
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
144 ## A global installation (package available to all users) is forced, even if
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
145 ## Octave is not being run with administrative privileges. The user must have
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
146 ## write access to the global package store.
12642
f96b9b9f141b doc: Periodic grammarcheck and spellcheck of documentation.
Rik <octave@nomad.inbox5.com>
parents: 12561
diff changeset
147 ##
12561
0ade5992e374 Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents: 12167
diff changeset
148 ## @item -forge
25836
07cb3e098c0a Use "Octave Forge" spelling in all files.
Rik <rik@octave.org>
parents: 25539
diff changeset
149 ## Install a package directly from the Octave Forge repository. This
12561
0ade5992e374 Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents: 12167
diff changeset
150 ## requires an internet connection and the cURL library.
6614
3a53d0f3e0e4 [project @ 2007-05-12 05:50:03 by dbateman]
dbateman
parents: 6500
diff changeset
151 ##
20708
453fca9ae397 pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents: 20480
diff changeset
152 ## @emph{Security risk}: no verification of the package is performed
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
153 ## before the installation. There are no signatures for packages, or
20708
453fca9ae397 pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents: 20480
diff changeset
154 ## checksums to confirm the correct file was downloaded. It has the
453fca9ae397 pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents: 20480
diff changeset
155 ## same security issues as manually downloading the package from the
453fca9ae397 pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents: 20480
diff changeset
156 ## Octave Forge repository and installing it.
453fca9ae397 pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents: 20480
diff changeset
157 ##
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
158 ## @item -verbose
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
159 ## The package manager will print the output of all commands as
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
160 ## they are performed.
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
161 ## @end table
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
162 ##
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
163 ## @item update
25836
07cb3e098c0a Use "Octave Forge" spelling in all files.
Rik <rik@octave.org>
parents: 25539
diff changeset
164 ## Check installed Octave Forge packages against repository and update any
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
165 ## outdated items. Updated packages are installed either globally or locally
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
166 ## depending on whether Octave is running with elevated privileges. This
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
167 ## requires an internet connection and the cURL library.
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
168 ##
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
169 ## Options for the install command and the names of individual packages to be
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
170 ## checked for updates may be specified as a list following the update
31375
96f751f8392c doc: grammar check documentation ahead of 8.1 release.
Rik <rik@octave.org>
parents: 31195
diff changeset
171 ## command. If the @option{-local} or @option{-global} option is specified,
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
172 ## @code{pkg update} limits the update check to the local or global installed
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
173 ## packages, and installs updates in that same context. For example,
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
174 ##
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
175 ## Update all packages:
31375
96f751f8392c doc: grammar check documentation ahead of 8.1 release.
Rik <rik@octave.org>
parents: 31195
diff changeset
176 ##
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
177 ## @example
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
178 ## pkg update
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
179 ## @end example
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
180 ##
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
181 ## Update all local packages:
31375
96f751f8392c doc: grammar check documentation ahead of 8.1 release.
Rik <rik@octave.org>
parents: 31195
diff changeset
182 ##
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
183 ## @example
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
184 ## pkg update -local
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
185 ## @end example
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
186 ##
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
187 ## Update certain packages, ignore dependencies, max verbosity:
31375
96f751f8392c doc: grammar check documentation ahead of 8.1 release.
Rik <rik@octave.org>
parents: 31195
diff changeset
188 ##
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
189 ## @example
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
190 ## pkg update -verbose -nodeps image signal geometry
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
191 ## @end example
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
192 ##
30411
0fee9e910d84 doc: Update pkg documentation related to local/global install (bug #59821).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 29878
diff changeset
193 ## @noindent
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
194 ## Updates for multiple packages are sorted alphabetically and not checked
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
195 ## for dependencies affected by installation order. If dependency order
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
196 ## related @code{pkg update} failure occurs, use @code{pkg update -nodeps} to
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
197 ## ignore dependencies, or @code{pkg install -forge <package_name>} to update
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
198 ## individual packages manually.
24966
70490bb1f59d pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24965
diff changeset
199 ##
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
200 ## @item uninstall
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
201 ## Uninstall named packages. For example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
202 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
203 ## @example
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
204 ## pkg uninstall image
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
205 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
206 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
207 ## @noindent
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
208 ## removes the @code{image} package from the system. If another installed
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
209 ## package depends on the @code{image} package an error will be issued.
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 10685
diff changeset
210 ## The package can be uninstalled anyway by using the @option{-nodeps} option.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
211 ##
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
212 ## @item load
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
213 ## Add named packages to the path. After loading a package it is
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
214 ## possible to use the functions provided by the package. For example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
215 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
216 ## @example
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
217 ## pkg load image
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
218 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
219 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
220 ## @noindent
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
221 ## adds the @code{image} package to the path.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
222 ##
28023
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
223 ## Note: When loading a package, @code{pkg} will automatically try to load
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
224 ## any unloaded dependencies as well, unless the @option{-nodeps} flag has
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
225 ## been specified. For example,
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
226 ##
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
227 ## @example
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
228 ## pkg load signal
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
229 ## @end example
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
230 ##
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
231 ## @noindent
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
232 ## adds the @code{signal} package and also tries to load its dependency: the
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
233 ## @code{control} package. Be aware that the functionality of package(s)
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
234 ## loaded will probably be impacted by use of the @option{-nodeps} flag. Even
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
235 ## if necessary dependencies are loaded later, the functionality of top-level
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
236 ## packages can still be affected because the optimal loading order may not
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
237 ## have been followed.
28023
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
238 ##
6203
512d72ee321f [project @ 2006-12-06 18:00:13 by jwe]
jwe
parents: 6189
diff changeset
239 ## @item unload
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
240 ## Remove named packages from the path. After unloading a package it is
28023
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
241 ## no longer possible to use the functions provided by the package. Trying
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
242 ## to unload a package that other loaded packages still depend on will result
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
243 ## in an error; no packages will be unloaded in this case. A package can
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
244 ## be forcibly removed with the @option{-nodeps} flag, but be aware that the
28714
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
245 ## functionality of dependent packages will likely be affected. As when
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
246 ## loading packages, reloading dependencies after having unloaded them with the
d8dcb36bb904 maint: spellcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28713
diff changeset
247 ## @option{-nodeps} flag may not restore all functionality of the dependent
28023
915b3630eed0 pkg.m: Don't unload dependency packages when their dependers are loaded (bug #57522).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27923
diff changeset
248 ## packages as the required loading order may be incorrect.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
249 ##
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
250 ## @item list
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
251 ## Show the list of currently installed packages. For example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
252 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
253 ## @example
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
254 ## pkg list
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
255 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
256 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
257 ## @noindent
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
258 ## will produce a short report with the package name, version, and installation
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19596
diff changeset
259 ## directory for each installed package. Supply a package name to limit
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
260 ## reporting to a particular package. For example:
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
261 ##
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
262 ## @example
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
263 ## pkg list image
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
264 ## @end example
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
265 ##
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
266 ## If a single return argument is requested then @code{pkg} returns a cell
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
267 ## array where each element is a structure with information on a single
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
268 ## package.
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
269 ##
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
270 ## @example
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
271 ## installed_packages = pkg ("list")
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
272 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
273 ##
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
274 ## If two output arguments are requested @code{pkg} splits the list of
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
275 ## installed packages into those which were installed by the current user,
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
276 ## and those which were installed by the system administrator.
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 12931
diff changeset
277 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
278 ## @example
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
279 ## [user_packages, system_packages] = pkg ("list")
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
280 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
281 ##
25836
07cb3e098c0a Use "Octave Forge" spelling in all files.
Rik <rik@octave.org>
parents: 25539
diff changeset
282 ## The @qcode{"-forge"} option lists packages available at the Octave Forge
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
283 ## repository. This requires an internet connection and the cURL library.
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17243
diff changeset
284 ## For example:
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
285 ##
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
286 ## @example
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
287 ## oct_forge_pkgs = pkg ("list", "-forge")
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
288 ## @end example
12561
0ade5992e374 Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents: 12167
diff changeset
289 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
290 ## @item describe
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
291 ## Show a short description of installed packages. With the option
21546
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 21518
diff changeset
292 ## @qcode{"-verbose"} also list functions provided by the package. For
f7f97d7e9294 doc: Wrap m-file docstrings to 79 characters + newline (80 total).
Rik <rik@octave.org>
parents: 21518
diff changeset
293 ## example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
294 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
295 ## @example
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
296 ## pkg describe -verbose
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
297 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
298 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
299 ## @noindent
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
300 ## will describe all installed packages and the functions they provide.
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
301 ## Display can be limited to a set of packages:
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
302 ##
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
303 ## @example
27794
45ad2127582b doc: grammarcheck scripts before 6.1 release.
Rik <rik@octave.org>
parents: 27707
diff changeset
304 ## @group
26577
ae1542fb58ba documentation: Avoid some overfull lines in the PDF manual.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26376
diff changeset
305 ## ## describe control and signal packages
ae1542fb58ba documentation: Avoid some overfull lines in the PDF manual.
Markus Mützel <markus.muetzel@gmx.de>
parents: 26376
diff changeset
306 ## pkg describe control signal
27794
45ad2127582b doc: grammarcheck scripts before 6.1 release.
Rik <rik@octave.org>
parents: 27707
diff changeset
307 ## @end group
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
308 ## @end example
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
309 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
310 ## If one output is requested a cell of structure containing the
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
311 ## description and list of functions of each package is returned as
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
312 ## output rather than printed on screen:
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
313 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
314 ## @example
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
315 ## desc = pkg ("describe", "secs1d", "image")
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
316 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
317 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
318 ## @noindent
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
319 ## If any of the requested packages is not installed, @code{pkg} returns an
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
320 ## error, unless a second output is requested:
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
321 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
322 ## @example
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
323 ## [desc, flag] = pkg ("describe", "secs1d", "image")
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
324 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
325 ##
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
326 ## @noindent
17281
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17243
diff changeset
327 ## @var{flag} will take one of the values @qcode{"Not installed"},
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17243
diff changeset
328 ## @qcode{"Loaded"}, or
bc924baa2c4e doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents: 17243
diff changeset
329 ## @qcode{"Not loaded"} for each of the named packages.
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
330 ##
6034
5cbbf96b52da [project @ 2006-10-04 18:45:43 by jwe]
jwe
parents: 6033
diff changeset
331 ## @item prefix
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
332 ## Set the installation prefix directory. For example,
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
333 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
334 ## @example
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
335 ## pkg prefix ~/my_octave_packages
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
336 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
337 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
338 ## @noindent
9307
c2923c27c877 Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents: 9258
diff changeset
339 ## sets the installation prefix to @file{~/my_octave_packages}.
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
340 ## Packages will be installed in this directory.
6034
5cbbf96b52da [project @ 2006-10-04 18:45:43 by jwe]
jwe
parents: 6033
diff changeset
341 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
342 ## It is possible to get the current installation prefix by requesting an
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
343 ## output argument. For example:
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
344 ##
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
345 ## @example
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
346 ## pfx = pkg ("prefix")
6070
df821c22355c [project @ 2006-10-23 19:01:04 by jwe]
jwe
parents: 6055
diff changeset
347 ## @end example
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
348 ##
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
349 ## The location in which to install the architecture dependent files can be
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
350 ## independently specified with an addition argument. For example:
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
351 ##
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
352 ## @example
9153
5247e89688e1 Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents: 9079
diff changeset
353 ## pkg prefix ~/my_octave_packages ~/my_arch_dep_pkgs
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
354 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
355 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
356 ## @item local_list
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
357 ## Set the file in which to look for information on locally
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
358 ## installed packages. Locally installed packages are those that are
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
359 ## available only to the current user. For example:
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
360 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
361 ## @example
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
362 ## pkg local_list ~/.octave_packages
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
363 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
364 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
365 ## It is possible to get the current value of local_list with the following
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
366 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
367 ## @example
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
368 ## pkg local_list
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
369 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
370 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
371 ## @item global_list
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
372 ## Set the file in which to look for information on globally
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
373 ## installed packages. Globally installed packages are those that are
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
374 ## available to all users. For example:
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
375 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
376 ## @example
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
377 ## pkg global_list /usr/share/octave/octave_packages
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
378 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
379 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
380 ## It is possible to get the current value of global_list with the following
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
381 ##
6189
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
382 ## @example
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
383 ## pkg global_list
0d23b0c0ce1a [project @ 2006-11-29 21:01:05 by dbateman]
dbateman
parents: 6143
diff changeset
384 ## @end example
10821
693e22af08ae Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents: 10793
diff changeset
385 ##
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
386 ## @item build
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
387 ## Build a binary form of a package or packages. The binary file produced
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
388 ## will itself be an Octave package that can be installed normally with
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8942
diff changeset
389 ## @code{pkg}. The form of the command to build a binary package is
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
390 ##
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
391 ## @example
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
392 ## pkg build builddir image-1.0.0.tar.gz @dots{}
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
393 ## @end example
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
394 ##
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
395 ## @noindent
9079
4d610aba7347 Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents: 9051
diff changeset
396 ## where @code{builddir} is the name of a directory where the temporary
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
397 ## installation will be produced and the binary packages will be found.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11547
diff changeset
398 ## The options @option{-verbose} and @option{-nodeps} are respected, while
12779
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
399 ## all other options are ignored.
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
400 ##
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
401 ## @item rebuild
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
402 ## Rebuild the package database from the installed directories. This can
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
403 ## be used in cases where the package database has been corrupted.
095fd5c8b7e1 doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents: 12778
diff changeset
404 ##
28064
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
405 ## @item test
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
406 ## Perform the built-in self tests contained in all functions provided by
28713
28d2511f2af2 maint: grammarcheck documentation ahead of 6.1 release.
Rik <rik@octave.org>
parents: 28666
diff changeset
407 ## the named packages. For example:
28064
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
408 ##
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
409 ## @example
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
410 ## pkg test image
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
411 ## @end example
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
412 ##
6032
dcecca0396e6 [project @ 2006-10-04 17:35:15 by jwe]
jwe
parents: 6025
diff changeset
413 ## @end table
19192
8a8a7bc2a09d Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents: 19187
diff changeset
414 ## @seealso{ver, news}
11547
e1851653d59c Eliminate @deffn macros.
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
415 ## @end deftypefn
5947
009fa69b6182 [project @ 2006-08-21 16:15:20 by jwe]
jwe
parents: 5928
diff changeset
416
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
417 function [local_packages, global_packages] = pkg (varargin)
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
418
28133
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
419 ## Installation prefix
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
420 persistent user_prefix = false;
16304
c8e1b0213e34 pkg.m: Fix str-to-num warnings (bug #37785)
Rik <rik@octave.org>
parents: 16173
diff changeset
421 persistent prefix = false;
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
422 persistent archprefix = -1;
29462
280defaf2023 pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29359
diff changeset
423 persistent local_list = fullfile (user_config_dir (), "octave", ...
29878
2cc14e275a51 pkg.m: Install local packages in API dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29580
diff changeset
424 __octave_config_info__ ("api_version"), ...
29462
280defaf2023 pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29359
diff changeset
425 "octave_packages");
280defaf2023 pkg.m: Install local packages in version dependent path (bug #58299).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29359
diff changeset
426 persistent global_list = fullfile (OCTAVE_HOME (), "share", "octave", ...
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
427 "octave_packages");
14471
d2c095e45196 maint: Remove redundant private function from the package manager.
Carlo de Falco <kingcrimson@tiscali.it>
parents: 14466
diff changeset
428
28133
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
429 ## If user is superuser (posix) or the process has elevated rights (Windows),
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
430 ## set global_install to true.
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
431 if (ispc () && ! isunix ())
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
432 global_install = __is_elevated_process__ ();
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
433 else
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
434 global_install = (geteuid () == 0);
baf16e6f498b pkg.m: Install packages globally if process has elevated rights (bug #44548).
Markus Mützel <markus.muetzel@gmx.de>
parents: 28064
diff changeset
435 endif
6683
a2f697dca2a4 [project @ 2007-06-01 23:10:24 by dbateman]
dbateman
parents: 6675
diff changeset
436
29579
3a9000d18596 pkg.m: Use default prefixes unless otherwise set previously (bug #60472).
Markus Mützel <markus.muetzel@gmx.de>
parents: 29358
diff changeset
437 if (! user_prefix)
18448
b26d6be1767a Move definifion of default package paths to separate function.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 17744
diff changeset
438 [prefix, archprefix] = default_prefix (global_install);
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
439 prefix = tilde_expand (prefix);
6925
1401a79af68c [project @ 2007-09-26 18:58:52 by dbateman]
dbateman
parents: 6820
diff changeset
440 archprefix = tilde_expand (archprefix);
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
441 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
442
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
443 mlock ();
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
444
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
445 confirm_recursive_rmdir (false, "local");
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
446
28942
fc4bb4bd1d5e maint: Use '##' as lead-in for full-line comments.
Rik <rik@octave.org>
parents: 28877
diff changeset
447 ## valid actions in alphabetical order
24965
0974a3649c81 pkg.m: alphabetic order of available_actions
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24934
diff changeset
448 available_actions = {"build", "describe", "global_list", "install", ...
0974a3649c81 pkg.m: alphabetic order of available_actions
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24934
diff changeset
449 "list", "load", "local_list", "prefix", "rebuild", ...
28064
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
450 "test", "uninstall", "unload", "update"};
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
451
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
452 ## Parse input arguments
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
453 if (isempty (varargin) || ! iscellstr (varargin))
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
454 print_usage ();
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
455 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
456 files = {};
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
457 deps = true;
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
458 action = "none";
6614
3a53d0f3e0e4 [project @ 2007-05-12 05:50:03 by dbateman]
dbateman
parents: 6500
diff changeset
459 verbose = false;
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
460 octave_forge = false;
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
461 for i = 1:numel (varargin)
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
462 switch (varargin{i})
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
463 case "-nodeps"
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
464 deps = false;
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
465 ## TODO completely remove these warnings after some releases.
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
466 case "-noauto"
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
467 warning ("Octave:deprecated-option",
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
468 ["pkg: autoload is no longer supported. The -noauto "...
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
469 "option is no longer required."]);
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
470 case "-auto"
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
471 warning ("Octave:deprecated-option",
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
472 ["pkg: autoload is no longer supported. Add a "...
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
473 "'pkg load ...' command to octaverc instead."]);
6614
3a53d0f3e0e4 [project @ 2007-05-12 05:50:03 by dbateman]
dbateman
parents: 6500
diff changeset
474 case "-verbose"
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
475 verbose = true;
13275
635db52feab4 pkg.m: Display verbose output immediately rather than buffering it.
Rik <octave@nomad.inbox5.com>
parents: 13141
diff changeset
476 ## Send verbose output to pager immediately. Change setting locally.
635db52feab4 pkg.m: Display verbose output immediately rather than buffering it.
Rik <octave@nomad.inbox5.com>
parents: 13141
diff changeset
477 page_output_immediately (true, "local");
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
478 case "-forge"
21434
1da428cbf401 deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents: 20852
diff changeset
479 if (! __octave_config_info__ ("CURL_LIBS"))
25841
0d4b88086f36 doc: use "Octave Forge" spelling in a few more instances
Mike Miller <mtmiller@octave.org>
parents: 25836
diff changeset
480 error ("pkg: can't download from Octave Forge without the cURL library");
15184
0b29c16a2645 pkg: check cURL library when using -forge
Carnë Draug <carandraug+dev@gmail.com>
parents: 15058
diff changeset
481 endif
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
482 octave_forge = true;
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
483 case "-local"
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
484 global_install = false;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
485 if (! user_prefix)
18448
b26d6be1767a Move definifion of default package paths to separate function.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 17744
diff changeset
486 [prefix, archprefix] = default_prefix (global_install);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
487 endif
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
488 case "-global"
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
489 global_install = true;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
490 if (! user_prefix)
18448
b26d6be1767a Move definifion of default package paths to separate function.
Carlo de Falco <cdf@users.sourceforge.net>
parents: 17744
diff changeset
491 [prefix, archprefix] = default_prefix (global_install);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
492 endif
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
493 case available_actions
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
494 if (! strcmp (action, "none"))
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
495 error ("pkg: more than one action specified");
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
496 endif
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
497 action = varargin{i};
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
498 otherwise
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
499 files{end+1} = varargin{i};
5801
70013c9f3ccc [project @ 2006-05-10 16:53:03 by jwe]
jwe
parents:
diff changeset
500 endswitch
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
501 endfor
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
502
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
503 if (octave_forge && ! any (strcmp (action, {"install", "list"})))
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
504 error ("pkg: '-forge' can only be used with install or list");
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
505 endif
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
506
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
507 ## Take action
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
508 switch (action)
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
509 case "list"
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
510 if (octave_forge)
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
511 if (nargout)
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
512 local_packages = list_forge_packages ();
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
513 else
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
514 list_forge_packages ();
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
515 endif
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
516 else
20480
ad7fe3cb6fd2 pkg: fix regression on output of pkg list (bug #45873)
Carnë Draug <carandraug@octave.org>
parents: 20475
diff changeset
517 if (nargout == 1)
ad7fe3cb6fd2 pkg: fix regression on output of pkg list (bug #45873)
Carnë Draug <carandraug@octave.org>
parents: 20475
diff changeset
518 local_packages = installed_packages (local_list, global_list, files);
ad7fe3cb6fd2 pkg: fix regression on output of pkg list (bug #45873)
Carnë Draug <carandraug@octave.org>
parents: 20475
diff changeset
519 elseif (nargout > 1)
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
520 [local_packages, global_packages] = installed_packages (local_list,
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
521 global_list,
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
522 files);
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
523 else
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
524 installed_packages (local_list, global_list, files);
10685
81a43049dee2 support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10684
diff changeset
525 endif
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
526 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
527
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
528 case "install"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
529 if (isempty (files))
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
530 error ("pkg: install action requires at least one filename");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
531 endif
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
532
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
533 local_files = {};
25140
ad6dce96cbca pkg.m: fix undefined variable error in install (bug #53567)
Mike Miller <mtmiller@octave.org>
parents: 25131
diff changeset
534 tmp_dir = tempname ();
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
535 unwind_protect
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
536
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
537 if (octave_forge)
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
538 [urls, local_files] = cellfun ("get_forge_download", files,
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
539 "uniformoutput", false);
31195
776446acdc7b pkg.m: Show URL of source tarball(s) in verbose mode.
Markus Mützel <markus.muetzel@gmx.de>
parents: 31126
diff changeset
540 if (verbose)
776446acdc7b pkg.m: Show URL of source tarball(s) in verbose mode.
Markus Mützel <markus.muetzel@gmx.de>
parents: 31126
diff changeset
541 fprintf ("downloading tarball(s) from:%s\n", ...
776446acdc7b pkg.m: Show URL of source tarball(s) in verbose mode.
Markus Mützel <markus.muetzel@gmx.de>
parents: 31126
diff changeset
542 sprintf ("\n- %s", urls{:}));
776446acdc7b pkg.m: Show URL of source tarball(s) in verbose mode.
Markus Mützel <markus.muetzel@gmx.de>
parents: 31126
diff changeset
543 endif
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
544 [files, succ] = cellfun ("urlwrite", urls, local_files,
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
545 "uniformoutput", false);
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
546 succ = [succ{:}];
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
547 if (! all (succ))
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
548 i = find (! succ, 1);
27574
c89a6f3eab69 pkg.m: Use uppercase URL in documentation and error messages.
Rik <rik@octave.org>
parents: 27573
diff changeset
549 error ("pkg: could not download file %s from URL %s",
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
550 local_files{i}, urls{i});
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
551 endif
24871
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
552 else
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
553 ## If files do not exist, maybe they are not local files.
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
554 ## Try to download them.
26589
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
555 not_local_files = cellfun (@(x) isempty (glob (x)), files);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
556 if (any (not_local_files))
25140
ad6dce96cbca pkg.m: fix undefined variable error in install (bug #53567)
Mike Miller <mtmiller@octave.org>
parents: 25131
diff changeset
557 [success, msg] = mkdir (tmp_dir);
24871
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
558 if (success != 1)
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
559 error ("pkg: failed to create temporary directory: %s", msg);
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
560 endif
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
561
26589
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
562 for file = files(not_local_files)
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
563 file = file{1};
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
564 [~, fname, fext] = fileparts (file);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
565 tmp_file = fullfile (tmp_dir, [fname fext]);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
566 local_files{end+1} = tmp_file;
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
567 looks_like_url = regexp (file, '^\w+://');
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
568 if (looks_like_url)
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
569 [~, success, msg] = urlwrite (file, local_files{end});
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
570 if (success != 1)
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
571 error ("pkg: failed downloading '%s': %s", file, msg);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
572 endif
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
573 ## Verify that download is a tarball,
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
574 ## to protect against ISP DNS hijacking.
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
575 ## FIXME: Need a test which does not rely on external OS.
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
576 #{
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
577 if (isunix ())
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
578 [ok, file_descr] = ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
579 system (sprintf ('file "%s" | cut -d ":" -f 2', ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
580 local_files{end}));
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
581 if (! ok)
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
582 if (strfind (file_descr, "HTML"))
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
583 error (["pkg: Invalid package file downloaded from " ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
584 "%s\n" ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
585 "File is HTML, not a tar archive."], ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
586 file);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
587 endif
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
588 else
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
589 ## Ignore: maybe something went wrong with the "file" call.
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
590 endif
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
591 endif
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
592 #}
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
593 else
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
594 looks_like_pkg_name = regexp (file, '^[\w-]+$');
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
595 if (looks_like_pkg_name)
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
596 error (["pkg: file not found: %s.\n" ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
597 "This looks like an Octave Forge package name." ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
598 " Did you mean:\n" ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
599 " pkg install -forge %s"], ...
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
600 file, file);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
601 else
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
602 error ("pkg: file not found: %s", file);
5bfbcbec6826 pkg.m: Clearer error messages when file doesn't exist or -forge switch is forgotten (bug #55515).
Andrew Janke <andrew@apjanke.net>
parents: 26376
diff changeset
603 endif
25030
62186547b752 pkg.m: remove yes-no question when installing from URI.
Carnë Draug <carandraug@octave.org>
parents: 24934
diff changeset
604 endif
26856
65c036b78040 pkg.m: Fix regression installing pkgs from URL (bug #55843).
Rik <rik@octave.org>
parents: 26595
diff changeset
605 files{strcmp (files, file)} = local_files{end};
24872
a26f8c97df21 warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents: 24871
diff changeset
606
24871
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
607 endfor
ca43264971ea pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents: 24534
diff changeset
608 endif
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
609 endif
31126
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
610
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
611 ## make sure the PREFIX and the ARCHPREFIX directories are created
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
612 if (! isfolder (prefix))
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
613 mkdir (prefix);
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
614 endif
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
615 if (! isfolder (archprefix))
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
616 mkdir (archprefix);
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
617 endif
65c4d98352d3 pkg.m: Create PREFIX and ARCHPREFIX directories (bug #62681).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30930
diff changeset
618
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
619 install (files, deps, prefix, archprefix, verbose, local_list,
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
620 global_list, global_install);
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
621
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
622 unwind_protect_cleanup
28503
f480103d8333 Fix unlink() calls in package m-files for new syntax (bug #57830)
Rik <rik@octave.org>
parents: 28501
diff changeset
623 [~] = cellfun ("unlink", local_files);
25131
0cd7076a97c8 pkg.m: Don't leave behind temporary directories if error occurs during install (bug #53567).
Rik <rik@octave.org>
parents: 25054
diff changeset
624 if (exist (tmp_dir, "file"))
28877
cd2178d0e43b pkg.m,build.m: capture output of rmdir() so that error is not thrown.
Rik <rik@octave.org>
parents: 28715
diff changeset
625 [~] = rmdir (tmp_dir, "s");
25131
0cd7076a97c8 pkg.m: Don't leave behind temporary directories if error occurs during install (bug #53567).
Rik <rik@octave.org>
parents: 25054
diff changeset
626 endif
10684
76aba4305f1f support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents: 10549
diff changeset
627 end_unwind_protect
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
628
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
629 case "uninstall"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
630 if (isempty (files))
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
631 error ("pkg: uninstall action requires at least one package name");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
632 endif
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
633 uninstall (files, deps, verbose, local_list, global_list, global_install);
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
634
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
635 case "load"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
636 if (isempty (files))
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
637 error ("pkg: load action requires at least one package name");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
638 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
639 load_packages (files, deps, local_list, global_list);
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
640
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
641 case "unload"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
642 if (isempty (files))
21954
6da01de4dd8a pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents: 21634
diff changeset
643 error ("pkg: unload action requires at least one package name");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
644 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
645 unload_packages (files, deps, local_list, global_list);
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
646
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
647 case "prefix"
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
648 if (isempty (files) && ! nargout)
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
649 printf ("Installation prefix: %s\n", prefix);
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
650 printf ("Architecture dependent prefix: %s\n", archprefix);
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
651 elseif (isempty (files) && nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
652 local_packages = prefix;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
653 global_packages = archprefix;
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
654 elseif (numel (files) >= 1 && ischar (files{1}))
16173
40a9a4e0d12a pkg.m: Restore ability to use '~' in specifying prefix directories.
Rik <rik@octave.org>
parents: 15966
diff changeset
655 prefix = tilde_expand (files{1});
26100
7a8f895c8f15 pkg.m: Don't create 'prefix' directory until needed (bug #53577).
Rik <rik@octave.org>
parents: 25842
diff changeset
656 local_packages = prefix = make_absolute_filename (prefix);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
657 user_prefix = true;
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
658 if (numel (files) >= 2 && ischar (files{2}))
26100
7a8f895c8f15 pkg.m: Don't create 'prefix' directory until needed (bug #53577).
Rik <rik@octave.org>
parents: 25842
diff changeset
659 archprefix = make_absolute_filename (tilde_expand (files{2}));
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
660 endif
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
661 else
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
662 error ("pkg: prefix action requires a directory input, or an output argument");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
663 endif
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
664
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
665 case "local_list"
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
666 if (isempty (files) && ! nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
667 disp (local_list);
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
668 elseif (isempty (files) && nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
669 local_packages = local_list;
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
670 elseif (numel (files) == 1 && ! nargout && ischar (files{1}))
28278
3cffb5c059b4 pkg.m: Perform tilde expansion on 'local_list' argument (bug #58332).
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 28133
diff changeset
671 local_list = tilde_expand (files{1});
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
672 if (! exist (local_list, "file"))
15000
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
673 try
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
674 ## Force file to be created
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
675 fclose (fopen (local_list, "wt"));
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
676 catch
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
677 error ("pkg: cannot create file %s", local_list);
15000
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
678 end_try_catch
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
679 endif
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
680 local_list = canonicalize_file_name (local_list);
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
681 else
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
682 error ("pkg: specify a local_list file, or request an output argument");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
683 endif
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
684
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
685 case "global_list"
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
686 if (isempty (files) && ! nargout)
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
687 disp (global_list);
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
688 elseif (isempty (files) && nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
689 local_packages = global_list;
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
690 elseif (numel (files) == 1 && ! nargout && ischar (files{1}))
15000
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
691 global_list = files{1};
19593
446c46af4b42 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
692 if (! exist (global_list, "file"))
15000
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
693 try
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
694 ## Force file to be created
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
695 fclose (fopen (files{1}, "wt"));
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
696 catch
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
697 error ("pkg: cannot create file %s", global_list);
15000
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
698 end_try_catch
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
699 endif
4c8ddf57fcda remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents: 14860
diff changeset
700 global_list = canonicalize_file_name (global_list);
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
701 else
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
702 error ("pkg: specify a global_list file, or request an output argument");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
703 endif
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
704
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
705 case "rebuild"
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
706 if (global_install)
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11547
diff changeset
707 global_packages = rebuild (prefix, archprefix, global_list, files,
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
708 verbose);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
709 global_packages = save_order (global_packages);
27573
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
710 if (ispc)
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
711 ## On Windows ensure LFN paths are saved rather than 8.3 style paths
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
712 global_packages = standardize_paths (global_packages);
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
713 endif
27707
377f069841c1 Make packages installation dirs in global octave_packages file relative
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 27574
diff changeset
714 global_packages = make_rel_paths (global_packages);
30930
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
715 global_list_dir = fileparts (global_list);
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
716 if (! isempty (global_list_dir) && ! exist (global_list_dir, "dir"))
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
717 mkdir (global_list_dir);
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
718 endif
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
719 save (global_list, "global_packages");
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
720 if (nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
721 local_packages = global_packages;
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
722 endif
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
723 else
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
724 local_packages = rebuild (prefix, archprefix, local_list, files,
21624
cf227735d5fd pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents: 21546
diff changeset
725 verbose);
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
726 local_packages = save_order (local_packages);
27573
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
727 if (ispc)
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
728 local_packages = standardize_paths (local_packages);
0cedd1e23c1f Adapt path styles for pkg.m on Windows (bug #57083)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 26856
diff changeset
729 endif
30930
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
730 local_list_dir = fileparts (local_list);
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
731 if (! isempty (local_list_dir) && ! exist (local_list_dir, "dir"))
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
732 mkdir (local_list_dir);
f67d2ce5d6d4 pkg.m: Create directory before saving file (bug #62303).
Markus Mützel <markus.muetzel@gmx.de>
parents: 30564
diff changeset
733 endif
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
734 save (local_list, "local_packages");
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
735 if (! nargout)
10549
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
736 clear ("local_packages");
95c3e38098bf Untabify .m scripts
Rik <code@nomad.inbox5.com>
parents: 10401
diff changeset
737 endif
6645
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
738 endif
81eb28d50cee [project @ 2007-05-21 21:05:54 by dbateman]
dbateman
parents: 6634
diff changeset
739
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
740 case "build"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
741 if (numel (files) < 2)
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
742 error ("pkg: build action requires build directory and at least one filename");
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
743 endif
21518
2ee20a290d61 pkg build: complete rewrite of the logic behind binary packages.
Carnë Draug <carandraug@octave.org>
parents: 21434
diff changeset
744 build (files{1}, files(2:end), verbose);
6675
f938c7018d28 [project @ 2007-05-31 19:31:14 by dbateman]
dbateman
parents: 6663
diff changeset
745
7497
bb7cc90cdc5e added describe command to pkg
carlo@guglielmo.local
parents: 7329
diff changeset
746 case "describe"
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
747 ## FIXME: name of the output variables is inconsistent with their content
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
748 if (nargout)
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
749 [local_packages, global_packages] = describe (files, verbose,
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
750 local_list, global_list);
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
751 else
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
752 describe (files, verbose, local_list, global_list);
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
753 endif
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11547
diff changeset
754
12778
0ca5672d5f1a Implement pkg update command
Lukas Reichlin <lukas.reichlin@gmail.com>
parents: 12710
diff changeset
755 case "update"
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
756 installed_pkgs_lst = installed_packages (local_list, global_list);
25031
f2f813a55eec pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents: 24966
diff changeset
757
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
758 ## If -global or -local, limit updates to global or local list pkgs
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
759 globalflag = any (strcmp (varargin, "-global"));
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
760 localflag = any (strcmp (varargin, "-local"));
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
761 if (globalflag || localflag)
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
762 if (globalflag && localflag)
31548
c8ad083a5802 maint: Clean up m-files before Octave 8.1 release.
Rik <rik@octave.org>
parents: 31375
diff changeset
763 error ("pkg: cannot specify both global and local options.");
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
764 elseif (globalflag)
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
765 [~, installed_pkgs_lst] = installed_packages (local_list, global_list);
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
766 else
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
767 [installed_pkgs_lst, ~] = installed_packages (local_list, global_list);
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
768 endif
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
769 else
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
770 installed_pkgs_lst = installed_packages (local_list, global_list);
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
771 endif
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
772
26207
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
773 ## Explicit list of packages to update, rather than all packages
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
774 if (numel (files) > 0)
26207
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
775 update_lst = {};
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
776 installed_names = cellfun (@(idx) idx.name, installed_pkgs_lst,
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
777 "UniformOutput", false);
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
778 for i = 1:numel (files)
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
779 idx = find (strcmp (files{i}, installed_names), 1);
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
780 if (isempty (idx))
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
781 warning ("pkg: package %s is not installed - skipping update",
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
782 files{i});
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
783 else
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
784 update_lst = [ update_lst, installed_pkgs_lst(idx) ];
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
785 endif
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
786 endfor
b964092ad9f8 pkg.m: Allow updating a list of supplied packages, instead of all (bug #48151).
Nicholas R. Jankowski <jankowskin@asme.org>
parents: 26100
diff changeset
787 installed_pkgs_lst = update_lst;
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
788 endif
25031
f2f813a55eec pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents: 24966
diff changeset
789
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
790 for i = 1:numel (installed_pkgs_lst)
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
791 installed_pkg_name = installed_pkgs_lst{i}.name;
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
792 installed_pkg_version = installed_pkgs_lst{i}.version;
21998
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
793 try
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
794 forge_pkg_version = get_forge_pkg (installed_pkg_name);
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
795 catch
25841
0d4b88086f36 doc: use "Octave Forge" spelling in a few more instances
Mike Miller <mtmiller@octave.org>
parents: 25836
diff changeset
796 warning ("pkg: package %s not found on Octave Forge - skipping update\n",
21998
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
797 installed_pkg_name);
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
798 forge_pkg_version = "0";
cf5db742f552 pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents: 21954
diff changeset
799 end_try_catch
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
800 if (compare_versions (forge_pkg_version, installed_pkg_version, ">"))
30419
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
801 options_to_pass = varargin (strncmp (varargin, "-", 1));
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
802 options_to_pass(end+1) = "-forge";
420608d1d370 Enable pkg update to accept options for install (bug #56128, #60573, #60574)
Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
parents: 30411
diff changeset
803 feval (@pkg, "install", options_to_pass{:}, installed_pkg_name);
18556
4daf647c86c3 Implement pkg update pkgnametoupdate (Bug #41732)
John Donoghue <john.donoghue@ieee.org>
parents: 17744
diff changeset
804 endif
20475
7fa1970a655d pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents: 19833
diff changeset
805 endfor
12778
0ca5672d5f1a Implement pkg update command
Lukas Reichlin <lukas.reichlin@gmail.com>
parents: 12710
diff changeset
806
28064
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
807 case "test"
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
808 if (isempty (files))
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
809 error ("pkg: test action requires at least one package name");
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
810 endif
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
811 ## Make sure the requested packages are loaded
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
812 orig_path = path ();
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
813 load_packages (files, deps, local_list, global_list);
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
814 ## Test packages one by one
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
815 installed_pkgs_lst = installed_packages (local_list, global_list, files);
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
816 unwind_protect
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
817 for i = 1:numel (installed_pkgs_lst)
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
818 printf ("Testing functions in package '%s':\n", files{i});
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
819 installed_pkgs_dirs = {installed_pkgs_lst{i}.dir, ...
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
820 installed_pkgs_lst{i}.archprefix};
28666
6b964cf58ed4 Fix typos in commit f4426602b5f8.
Markus Mützel <markus.muetzel@gmx.de>
parents: 28664
diff changeset
821 installed_pkgs_dirs = ...
6b964cf58ed4 Fix typos in commit f4426602b5f8.
Markus Mützel <markus.muetzel@gmx.de>
parents: 28664
diff changeset
822 installed_pkgs_dirs (! cellfun (@isempty, installed_pkgs_dirs));
28064
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
823 ## For local installs installed_pkgs_dirs contains the same subdirs
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
824 installed_pkgs_dirs = unique (installed_pkgs_dirs);
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
825 if (! isempty (installed_pkgs_dirs))
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
826 ## FIXME invoke another test routine once that is available.
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
827 ## Until then __run_test_suite__.m will do the job fine enough
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
828 __run_test_suite__ ({installed_pkgs_dirs{:}}, {});
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
829 endif
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
830 endfor
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
831 unwind_protect_cleanup
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
832 ## Restore load path back to its original value before loading packages
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
833 path (orig_path);
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
834 end_unwind_protect
fbed279b7074 pkg: add "test" command to test all functions in a package (bug #41215)
Mike Miller <mtmiller@octave.org>
parents: 28023
diff changeset
835
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
836 otherwise
20726
25d676f9619c Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents: 20708
diff changeset
837 error ("pkg: invalid action. See 'help pkg' for available actions");
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
838 endswitch
19187
b54093acb8fe ver.m: Overhaul function.
Rik <rik@octave.org>
parents: 18576
diff changeset
839
6496
e0acfe7c3f7b [project @ 2007-04-05 17:19:30 by jwe]
jwe
parents: 6440
diff changeset
840 endfunction