Mercurial > octave
annotate scripts/pkg/pkg.m @ 25031:f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
* scripts/pkg/pkg.m: this is what was meant to happen in 70490bb1f59d
(which instead removed the yes-no question during installation of
URI and went to the stable branch instead). Seems like no one has
actually been using this option, it's been broken for some time, and
it's not really that useful. Remove it. We are keeping the update
option to update all of the packages.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Wed, 28 Mar 2018 02:02:07 +0100 |
parents | 70490bb1f59d |
children | ae487ce89992 |
rev | line source |
---|---|
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
22529
diff
changeset
|
1 ## Copyright (C) 2005-2017 Søren Hauberg |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
2 ## Copyright (C) 2010 VZLU Prague, a.s. |
14466
cfb0173fe1ca
maint: Refactor pkg.m and move subfunctions to private/ directory.
Carlo de Falco <kingcrimson@tiscali.it>
parents:
14446
diff
changeset
|
3 ## Copyright (C) 2012 Carlo de Falco |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11547
diff
changeset
|
4 ## |
6440 | 5 ## This file is part of Octave. |
6 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
7 ## Octave is free software: you can redistribute it and/or modify it |
6440 | 8 ## 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
|
9 ## 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
|
10 ## (at your option) any later version. |
6440 | 11 ## |
12 ## Octave is distributed in the hope that it will be useful, but | |
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22529
diff
changeset
|
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22529
diff
changeset
|
15 ## GNU General Public License for more details. |
6440 | 16 ## |
5801 | 17 ## You should have received a copy of the GNU General Public License |
7016 | 18 ## 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
|
19 ## <https://www.gnu.org/licenses/>. |
5801 | 20 |
21 ## -*- texinfo -*- | |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20727
diff
changeset
|
22 ## @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
|
23 ## @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
|
24 ## @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
|
25 ## Manage or query packages (groups of add-on functions) for Octave. |
19187 | 26 ## |
22529
640c1b476860
pkg.m: more clearly document package querying options (bug #49156)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
22323
diff
changeset
|
27 ## Different actions are available depending on the value of @var{command} |
640c1b476860
pkg.m: more clearly document package querying options (bug #49156)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
22323
diff
changeset
|
28 ## and on return arguments. |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
29 ## |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
30 ## Available commands: |
6032 | 31 ## |
32 ## @table @samp | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
33 ## |
6032 | 34 ## @item install |
6070 | 35 ## Install named packages. For example, |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
36 ## |
6070 | 37 ## @example |
38 ## pkg install image-1.0.0.tar.gz | |
39 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
40 ## |
6070 | 41 ## @noindent |
24934
1db0b81efafe
maint: strip trailing whitespace from source files
Mike Miller <mtmiller@octave.org>
parents:
24877
diff
changeset
|
42 ## installs the package found in the file @file{image-1.0.0.tar.gz}. The |
24872
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
43 ## file containing the package can be an url, e.g. |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
44 ## |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
45 ## @example |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
46 ## 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
|
47 ## @end example |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
48 ## |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
49 ## @noindent |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
50 ## 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
|
51 ## 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
|
52 ## |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
53 ## @noindent |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
54 ## @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
|
55 ## before the installation. It has the same security issues as manually |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
56 ## downloading the package from the given url and installing it. |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
57 ## |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
58 ## @noindent |
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
59 ## @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
|
60 ## 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
|
61 ## 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
|
62 ## package directly (see the @file{DESCRIPTION} file of the package) |
6070 | 63 ## |
6645 | 64 ## 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
|
65 ## in which a package is installed. These options can be one or more of |
6645 | 66 ## |
67 ## @table @code | |
68 ## @item -nodeps | |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
69 ## 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
|
70 ## 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
|
71 ## which is not installed on the system. @strong{Use this option with care.} |
6645 | 72 ## |
73 ## @item -local | |
13141
e81ddf9cacd5
maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
12931
diff
changeset
|
74 ## A local installation (package available only to current user) is forced, |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
75 ## even if the user has system privileges. |
6258 | 76 ## |
6645 | 77 ## @item -global |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
78 ## A global installation (package available to all users) is forced, even if |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
79 ## the user doesn't normally have system privileges. |
12642
f96b9b9f141b
doc: Periodic grammarcheck and spellcheck of documentation.
Rik <octave@nomad.inbox5.com>
parents:
12561
diff
changeset
|
80 ## |
12561
0ade5992e374
Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents:
12167
diff
changeset
|
81 ## @item -forge |
0ade5992e374
Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents:
12167
diff
changeset
|
82 ## Install a package directly from the Octave-Forge repository. This |
0ade5992e374
Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents:
12167
diff
changeset
|
83 ## requires an internet connection and the cURL library. |
6614 | 84 ## |
20708
453fca9ae397
pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents:
20480
diff
changeset
|
85 ## @emph{Security risk}: no verification of the package is performed |
453fca9ae397
pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents:
20480
diff
changeset
|
86 ## before the installation. There are no signature for packages, or |
453fca9ae397
pkg: add warning about security implications when using -forge.
Carnë Draug <carandraug@octave.org>
parents:
20480
diff
changeset
|
87 ## 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
|
88 ## 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
|
89 ## 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
|
90 ## |
6645 | 91 ## @item -verbose |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
92 ## 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
|
93 ## they are performed. |
6645 | 94 ## @end table |
95 ## | |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
96 ## @item update |
13931
9de488c6c59c
doc: Spellcheck documentation before 3.6.0 release
Rik <octave@nomad.inbox5.com>
parents:
13864
diff
changeset
|
97 ## Check installed Octave-Forge packages against repository and update any |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
98 ## outdated items. This requires an internet connection and the cURL library. |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
99 ## Usage: |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
100 ## |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
101 ## @example |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
102 ## pkg update |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
103 ## @end example |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
104 ## |
24966
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
105 ## @noindent |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
106 ## To update a single package use @code{pkg install -forge} |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
107 ## |
6032 | 108 ## @item uninstall |
6070 | 109 ## Uninstall named packages. For example, |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
110 ## |
6070 | 111 ## @example |
112 ## pkg uninstall image | |
113 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
114 ## |
6070 | 115 ## @noindent |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8942
diff
changeset
|
116 ## removes the @code{image} package from the system. If another installed |
6070 | 117 ## 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
|
118 ## 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
|
119 ## |
6032 | 120 ## @item load |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8942
diff
changeset
|
121 ## 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
|
122 ## 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
|
123 ## |
6070 | 124 ## @example |
125 ## pkg load image | |
126 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
127 ## |
6070 | 128 ## @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
|
129 ## adds the @code{image} package to the path. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
130 ## |
6203 | 131 ## @item unload |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
132 ## Remove named packages from the path. After unloading a package it is |
21954
6da01de4dd8a
pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents:
21634
diff
changeset
|
133 ## no longer possible to use the functions provided by the package. |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
134 ## |
6032 | 135 ## @item list |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
136 ## 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
|
137 ## |
6070 | 138 ## @example |
19187 | 139 ## pkg list |
6070 | 140 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
141 ## |
6070 | 142 ## @noindent |
19187 | 143 ## 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
|
144 ## directory for each installed package. Supply a package name to limit |
19187 | 145 ## reporting to a particular package. For example: |
146 ## | |
147 ## @example | |
148 ## pkg list image | |
149 ## @end example | |
150 ## | |
151 ## If a single return argument is requested then @code{pkg} returns a cell | |
152 ## array where each element is a structure with information on a single | |
153 ## package. | |
154 ## | |
155 ## @example | |
156 ## installed_packages = pkg ("list") | |
157 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
158 ## |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
159 ## 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
|
160 ## 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
|
161 ## 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
|
162 ## |
6070 | 163 ## @example |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
164 ## [user_packages, system_packages] = pkg ("list") |
6070 | 165 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
166 ## |
19187 | 167 ## 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
|
168 ## 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
|
169 ## For example: |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
170 ## |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
171 ## @example |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
172 ## oct_forge_pkgs = pkg ("list", "-forge") |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
173 ## @end example |
12561
0ade5992e374
Add documentation for '-forge' option (bug #32464).
Rik <octave@nomad.inbox5.com>
parents:
12167
diff
changeset
|
174 ## |
7497 | 175 ## @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
|
176 ## 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
|
177 ## @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
|
178 ## example, |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
179 ## |
7497 | 180 ## @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
|
181 ## pkg describe -verbose |
7497 | 182 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
183 ## |
7497 | 184 ## @noindent |
185 ## 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
|
186 ## 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
|
187 ## |
6da01de4dd8a
pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents:
21634
diff
changeset
|
188 ## @example |
6da01de4dd8a
pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents:
21634
diff
changeset
|
189 ## pkg describe control signal # describe control and signal packages |
6da01de4dd8a
pkg: drop special usage of 'all' in load, unload, and describe (bug #40674)
Carnë Draug <carandraug@octave.org>
parents:
21634
diff
changeset
|
190 ## @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
|
191 ## |
7497 | 192 ## If one output is requested a cell of structure containing the |
193 ## description and list of functions of each package is returned as | |
194 ## output rather than printed on screen: | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
195 ## |
7497 | 196 ## @example |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
197 ## desc = pkg ("describe", "secs1d", "image") |
7497 | 198 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
199 ## |
7497 | 200 ## @noindent |
19187 | 201 ## If any of the requested packages is not installed, @code{pkg} returns an |
7497 | 202 ## error, unless a second output is requested: |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
203 ## |
7497 | 204 ## @example |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
205 ## [desc, flag] = pkg ("describe", "secs1d", "image") |
7497 | 206 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
207 ## |
7497 | 208 ## @noindent |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17243
diff
changeset
|
209 ## @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
|
210 ## @qcode{"Loaded"}, or |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
17243
diff
changeset
|
211 ## @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
|
212 ## |
6034 | 213 ## @item prefix |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8942
diff
changeset
|
214 ## Set the installation prefix directory. For example, |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
215 ## |
6070 | 216 ## @example |
217 ## pkg prefix ~/my_octave_packages | |
218 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
219 ## |
6070 | 220 ## @noindent |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9258
diff
changeset
|
221 ## sets the installation prefix to @file{~/my_octave_packages}. |
6070 | 222 ## Packages will be installed in this directory. |
6034 | 223 ## |
6070 | 224 ## 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
|
225 ## output argument. For example: |
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
226 ## |
6070 | 227 ## @example |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
228 ## pfx = pkg ("prefix") |
6070 | 229 ## @end example |
6925 | 230 ## |
231 ## 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
|
232 ## independently specified with an addition argument. For example: |
6925 | 233 ## |
234 ## @example | |
9153
5247e89688e1
Eliminate most overfull errors when running texi2pdf for generating pdf documentation
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
235 ## pkg prefix ~/my_octave_packages ~/my_arch_dep_pkgs |
6925 | 236 ## @end example |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
237 ## |
6189 | 238 ## @item local_list |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
239 ## 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
|
240 ## 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
|
241 ## available only to the current user. For example: |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
242 ## |
6189 | 243 ## @example |
244 ## pkg local_list ~/.octave_packages | |
245 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
246 ## |
6189 | 247 ## 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
|
248 ## |
6189 | 249 ## @example |
250 ## pkg local_list | |
251 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
252 ## |
6189 | 253 ## @item global_list |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
254 ## 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
|
255 ## 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
|
256 ## available to all users. For example: |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
257 ## |
6189 | 258 ## @example |
259 ## pkg global_list /usr/share/octave/octave_packages | |
260 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
261 ## |
6189 | 262 ## 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
|
263 ## |
6189 | 264 ## @example |
265 ## pkg global_list | |
266 ## @end example | |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
267 ## |
6675 | 268 ## @item build |
12779
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
269 ## Build a binary form of a package or packages. The binary file produced |
6675 | 270 ## 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
|
271 ## @code{pkg}. The form of the command to build a binary package is |
6675 | 272 ## |
273 ## @example | |
274 ## pkg build builddir image-1.0.0.tar.gz @dots{} | |
275 ## @end example | |
276 ## | |
277 ## @noindent | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
9051
diff
changeset
|
278 ## where @code{builddir} is the name of a directory where the temporary |
6675 | 279 ## 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
|
280 ## 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
|
281 ## all other options are ignored. |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
282 ## |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
283 ## @item rebuild |
095fd5c8b7e1
doc: Update docstring for pkg()
Rik <octave@nomad.inbox5.com>
parents:
12778
diff
changeset
|
284 ## 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
|
285 ## 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
|
286 ## |
6032 | 287 ## @end table |
19192
8a8a7bc2a09d
Improve docstrings and mark documentation m-files as tested in miscellaneous/ dir.
Rik <rik@octave.org>
parents:
19187
diff
changeset
|
288 ## @seealso{ver, news} |
11547 | 289 ## @end deftypefn |
5947 | 290 |
6496 | 291 function [local_packages, global_packages] = pkg (varargin) |
19187 | 292 |
8202
cf59d542f33e
replace all TODOs and XXXs with FIXMEs
Jaroslav Hajek <highegg@gmail.com>
parents:
8174
diff
changeset
|
293 ## Installation prefix (FIXME: what should these be on windows?) |
6645 | 294 persistent user_prefix = false; |
16304
c8e1b0213e34
pkg.m: Fix str-to-num warnings (bug #37785)
Rik <rik@octave.org>
parents:
16173
diff
changeset
|
295 persistent prefix = false; |
6925 | 296 persistent archprefix = -1; |
7498 | 297 persistent local_list = tilde_expand (fullfile ("~", ".octave_packages")); |
6496 | 298 persistent global_list = fullfile (OCTAVE_HOME (), "share", "octave", |
10549 | 299 "octave_packages"); |
14471
d2c095e45196
maint: Remove redundant private function from the package manager.
Carlo de Falco <kingcrimson@tiscali.it>
parents:
14466
diff
changeset
|
300 |
14472
045a5b85495d
maint: Remove redundant private function from the package manager.
Carlo de Falco <kingcrimson@tiscali.it>
parents:
14471
diff
changeset
|
301 ## If user is superuser set global_istall to true |
045a5b85495d
maint: Remove redundant private function from the package manager.
Carlo de Falco <kingcrimson@tiscali.it>
parents:
14471
diff
changeset
|
302 ## FIXME: is it OK to set this always true on windows? |
045a5b85495d
maint: Remove redundant private function from the package manager.
Carlo de Falco <kingcrimson@tiscali.it>
parents:
14471
diff
changeset
|
303 global_install = ((ispc () && ! isunix ()) || (geteuid () == 0)); |
6683 | 304 |
16304
c8e1b0213e34
pkg.m: Fix str-to-num warnings (bug #37785)
Rik <rik@octave.org>
parents:
16173
diff
changeset
|
305 if (isbool (prefix)) |
18448
b26d6be1767a
Move definifion of default package paths to separate function.
Carlo de Falco <cdf@users.sourceforge.net>
parents:
17744
diff
changeset
|
306 [prefix, archprefix] = default_prefix (global_install); |
6645 | 307 prefix = tilde_expand (prefix); |
6925 | 308 archprefix = tilde_expand (archprefix); |
6496 | 309 endif |
310 | |
19187 | 311 mlock (); |
312 | |
313 confirm_recursive_rmdir (false, "local"); | |
314 | |
24965
0974a3649c81
pkg.m: alphabetic order of available_actions
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24934
diff
changeset
|
315 # valid actions in alphabetical order |
0974a3649c81
pkg.m: alphabetic order of available_actions
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24934
diff
changeset
|
316 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
|
317 "list", "load", "local_list", "prefix", "rebuild", ... |
0974a3649c81
pkg.m: alphabetic order of available_actions
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24934
diff
changeset
|
318 "uninstall", "unload", "update"}; |
19187 | 319 |
320 ## Parse input arguments | |
321 if (isempty (varargin) || ! iscellstr (varargin)) | |
6496 | 322 print_usage (); |
323 endif | |
324 files = {}; | |
325 deps = true; | |
326 action = "none"; | |
6614 | 327 verbose = false; |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
328 octave_forge = false; |
19187 | 329 for i = 1:numel (varargin) |
6496 | 330 switch (varargin{i}) |
331 case "-nodeps" | |
10549 | 332 deps = false; |
21624
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
333 ## TODO completely remove these warnings after some releases. |
6496 | 334 case "-noauto" |
21624
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
335 warning ("Octave:deprecated-option", |
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
336 ["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
|
337 "option is no longer required."]); |
6496 | 338 case "-auto" |
21624
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
339 warning ("Octave:deprecated-option", |
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
340 ["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
|
341 "'pkg load ...' command to octaverc instead."]); |
6614 | 342 case "-verbose" |
10549 | 343 verbose = true; |
13275
635db52feab4
pkg.m: Display verbose output immediately rather than buffering it.
Rik <octave@nomad.inbox5.com>
parents:
13141
diff
changeset
|
344 ## 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
|
345 page_output_immediately (true, "local"); |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
346 case "-forge" |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
20852
diff
changeset
|
347 if (! __octave_config_info__ ("CURL_LIBS")) |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
15184
diff
changeset
|
348 error ("pkg: can't download from forge without the cURL library"); |
15184
0b29c16a2645
pkg: check cURL library when using -forge
Carnë Draug <carandraug+dev@gmail.com>
parents:
15058
diff
changeset
|
349 endif |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
350 octave_forge = true; |
6645 | 351 case "-local" |
10549 | 352 global_install = false; |
353 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
|
354 [prefix, archprefix] = default_prefix (global_install); |
10549 | 355 endif |
6645 | 356 case "-global" |
10549 | 357 global_install = true; |
358 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
|
359 [prefix, archprefix] = default_prefix (global_install); |
10549 | 360 endif |
7497 | 361 case available_actions |
19187 | 362 if (! strcmp (action, "none")) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
363 error ("pkg: more than one action specified"); |
10549 | 364 endif |
19187 | 365 action = varargin{i}; |
6496 | 366 otherwise |
10549 | 367 files{end+1} = varargin{i}; |
5801 | 368 endswitch |
6496 | 369 endfor |
370 | |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
371 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
|
372 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
|
373 endif |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
374 |
6496 | 375 ## Take action |
376 switch (action) | |
377 case "list" | |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
378 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
|
379 if (nargout) |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
380 local_packages = list_forge_packages (); |
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
381 else |
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
382 list_forge_packages (); |
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
383 endif |
6496 | 384 else |
20480
ad7fe3cb6fd2
pkg: fix regression on output of pkg list (bug #45873)
Carnë Draug <carandraug@octave.org>
parents:
20475
diff
changeset
|
385 if (nargout == 1) |
ad7fe3cb6fd2
pkg: fix regression on output of pkg list (bug #45873)
Carnë Draug <carandraug@octave.org>
parents:
20475
diff
changeset
|
386 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
|
387 elseif (nargout > 1) |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
388 [local_packages, global_packages] = installed_packages (local_list, |
19187 | 389 global_list, |
390 files); | |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
391 else |
20475
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
392 installed_packages (local_list, global_list, files); |
10685
81a43049dee2
support pkg list -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10684
diff
changeset
|
393 endif |
6496 | 394 endif |
395 | |
396 case "install" | |
19187 | 397 if (isempty (files)) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
398 error ("pkg: install action requires at least one filename"); |
6496 | 399 endif |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
400 |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
401 local_files = {}; |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
402 unwind_protect |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
403 |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
404 if (octave_forge) |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
405 [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
|
406 "uniformoutput", false); |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
407 [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
|
408 "uniformoutput", false); |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
409 succ = [succ{:}]; |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
410 if (! all (succ)) |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
411 i = find (! succ, 1); |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
412 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
|
413 local_files{i}, urls{i}); |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
414 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
|
415 else |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
416 ## 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
|
417 ## Try to download them. |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
418 external_files_mask = ! cellfun (@exist, files, {"file"}); |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
419 if (any (external_files_mask)) |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
420 [success, msg] = mkdir (tmp_dir = tempname ()); |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
421 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
|
422 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
|
423 endif |
24872
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
424 |
24871
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
425 for file_idx = find (external_files_mask) |
24872
a26f8c97df21
warning and yes_or_no for installing using url
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24871
diff
changeset
|
426 |
24966
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
427 [~, fname, fext] = fileparts (files{file_idx}); |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
428 local_files{end+1} = fullfile (tmp_dir, [fname fext]); |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
429 [~, success, msg] = urlwrite (files{file_idx}, local_files{end}); |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
430 if (success != 1) |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
431 error ("pkg: failed to read package '%s': %s", |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
432 files{file_idx}, msg); |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
433 endif |
70490bb1f59d
pkg.m: remove update of single package and update docstring
Juan Pablo Carbajal <ajuanpi+dev@gmail.com>
parents:
24965
diff
changeset
|
434 files{file_idx} = 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
|
435 |
24871
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
436 endfor |
ca43264971ea
pkg: allow URI for external files (https/ftp/etc links) as install targets
Carnë Draug <carandraug@octave.org>
parents:
24534
diff
changeset
|
437 endif |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
438 endif |
21624
cf227735d5fd
pkg: remove support for autoload (automatically loading package at start).
Carnë Draug <carandraug@octave.org>
parents:
21546
diff
changeset
|
439 install (files, deps, prefix, archprefix, verbose, local_list, |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
440 global_list, global_install); |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
441 |
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
442 unwind_protect_cleanup |
12931
cefd568ea073
Replace function handles with function names in cellfun calls for 15% speedup.
Rik <octave@nomad.inbox5.com>
parents:
12779
diff
changeset
|
443 cellfun ("unlink", local_files); |
10684
76aba4305f1f
support pkg install -forge
Jaroslav Hajek <highegg@gmail.com>
parents:
10549
diff
changeset
|
444 end_unwind_protect |
6496 | 445 |
446 case "uninstall" | |
19187 | 447 if (isempty (files)) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
448 error ("pkg: uninstall action requires at least one package name"); |
6496 | 449 endif |
19187 | 450 uninstall (files, deps, verbose, local_list, global_list, global_install); |
6496 | 451 |
452 case "load" | |
19187 | 453 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
|
454 error ("pkg: load action requires at least one package name"); |
6496 | 455 endif |
456 load_packages (files, deps, local_list, global_list); | |
457 | |
458 case "unload" | |
19187 | 459 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
|
460 error ("pkg: unload action requires at least one package name"); |
6496 | 461 endif |
462 unload_packages (files, deps, local_list, global_list); | |
463 | |
464 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
|
465 if (isempty (files) && ! nargout) |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
466 printf ("Installation prefix: %s\n", prefix); |
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
467 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
|
468 elseif (isempty (files) && nargout) |
10549 | 469 local_packages = prefix; |
470 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
|
471 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
|
472 prefix = tilde_expand (files{1}); |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
473 if (! exist (prefix, "dir")) |
19187 | 474 [status, msg] = mkdir (prefix); |
14858
a82fcd612c8f
pkg.m: Check if the prefix directory can be created; don't fail silently
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14857
diff
changeset
|
475 if (status == 0) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
476 error ("pkg: cannot create prefix %s: %s", prefix, msg); |
14858
a82fcd612c8f
pkg.m: Check if the prefix directory can be created; don't fail silently
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14857
diff
changeset
|
477 endif |
20727
a5949b3d2332
Preface warning() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20726
diff
changeset
|
478 warning ("pkg: creating the directory %s\n", prefix); |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
479 endif |
15058
3691a606283e
Fix typo in pkg.m reported in bug #36994.
Muhali <muhali@shaw.ca>
parents:
15000
diff
changeset
|
480 local_packages = prefix = canonicalize_file_name (prefix); |
10549 | 481 user_prefix = true; |
19187 | 482 if (numel (files) >= 2 && ischar (files{2})) |
16173
40a9a4e0d12a
pkg.m: Restore ability to use '~' in specifying prefix directories.
Rik <rik@octave.org>
parents:
15966
diff
changeset
|
483 archprefix = tilde_expand (files{2}); |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
484 if (! exist (archprefix, "dir")) |
19187 | 485 [status, msg] = mkdir (archprefix); |
14858
a82fcd612c8f
pkg.m: Check if the prefix directory can be created; don't fail silently
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14857
diff
changeset
|
486 if (status == 0) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
487 error ("pkg: cannot create archprefix %s: %s", archprefix, msg); |
14858
a82fcd612c8f
pkg.m: Check if the prefix directory can be created; don't fail silently
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14857
diff
changeset
|
488 endif |
20727
a5949b3d2332
Preface warning() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20726
diff
changeset
|
489 warning ("pkg: creating the directory %s\n", archprefix); |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
490 global_packages = archprefix = canonicalize_file_name (archprefix); |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
491 endif |
10549 | 492 endif |
6496 | 493 else |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
494 error ("pkg: prefix action requires a directory input, or an output argument"); |
6496 | 495 endif |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
496 |
6496 | 497 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
|
498 if (isempty (files) && ! nargout) |
10549 | 499 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
|
500 elseif (isempty (files) && nargout) |
10549 | 501 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
|
502 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
|
503 local_list = files{1}; |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
504 if (! exist (local_list, "file")) |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
505 try |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
506 ## Force file to be created |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
507 fclose (fopen (local_list, "wt")); |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
508 catch |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
509 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
|
510 end_try_catch |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
511 endif |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
512 local_list = canonicalize_file_name (local_list); |
6496 | 513 else |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
514 error ("pkg: specify a local_list file, or request an output argument"); |
6496 | 515 endif |
516 | |
517 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
|
518 if (isempty (files) && ! nargout) |
19187 | 519 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
|
520 elseif (isempty (files) && nargout) |
10549 | 521 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
|
522 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
|
523 global_list = files{1}; |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
524 if (! exist (global_list, "file")) |
15000
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
525 try |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
526 ## Force file to be created |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
527 fclose (fopen (files{1}, "wt")); |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
528 catch |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
529 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
|
530 end_try_catch |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
531 endif |
4c8ddf57fcda
remove redundant private function absolute_pathname
Carlo de Falco <cdf@users.sourceforge.net>
parents:
14860
diff
changeset
|
532 global_list = canonicalize_file_name (global_list); |
6496 | 533 else |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
534 error ("pkg: specify a global_list file, or request an output argument"); |
6496 | 535 endif |
6645 | 536 |
537 case "rebuild" | |
538 if (global_install) | |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11547
diff
changeset
|
539 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
|
540 verbose); |
10549 | 541 global_packages = save_order (global_packages); |
542 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
|
543 if (nargout) |
10549 | 544 local_packages = global_packages; |
545 endif | |
6645 | 546 else |
19187 | 547 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
|
548 verbose); |
10549 | 549 local_packages = save_order (local_packages); |
550 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
|
551 if (! nargout) |
10549 | 552 clear ("local_packages"); |
553 endif | |
6645 | 554 endif |
555 | |
6675 | 556 case "build" |
19187 | 557 if (numel (files) < 2) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
558 error ("pkg: build action requires build directory and at least one filename"); |
6675 | 559 endif |
21518
2ee20a290d61
pkg build: complete rewrite of the logic behind binary packages.
Carnë Draug <carandraug@octave.org>
parents:
21434
diff
changeset
|
560 build (files{1}, files(2:end), verbose); |
6675 | 561 |
7497 | 562 case "describe" |
19187 | 563 ## 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
|
564 if (nargout) |
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
565 [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
|
566 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
|
567 else |
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
568 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
|
569 endif |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11547
diff
changeset
|
570 |
12778
0ca5672d5f1a
Implement pkg update command
Lukas Reichlin <lukas.reichlin@gmail.com>
parents:
12710
diff
changeset
|
571 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
|
572 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
|
573 |
20475
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
574 if (numel (files) > 0) |
25031
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
575 ## This was option was broken during two releases and no one |
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
576 ## notice so we are guessing no one actually uses it. If the |
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
577 ## user knows the names of the packages to be installed, it |
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
578 ## might as well call install (which is what update is doing) |
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
579 error ("pkg: to update individual packages, use 'pkg install -forge'"); |
20475
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
580 endif |
25031
f2f813a55eec
pkg: remove update of listed packages (actually do 70490bb1f59d)
Carnë Draug <carandraug@octave.org>
parents:
24966
diff
changeset
|
581 |
20475
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
582 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
|
583 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
|
584 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
|
585 try |
cf5db742f552
pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents:
21954
diff
changeset
|
586 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
|
587 catch |
cf5db742f552
pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents:
21954
diff
changeset
|
588 warning ("pkg: package %s not found on forge - skipping update\n", |
cf5db742f552
pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents:
21954
diff
changeset
|
589 installed_pkg_name); |
cf5db742f552
pkg: warn and continue updating on non-forge packages (bug #48294)
Mike Miller <mtmiller@octave.org>
parents:
21954
diff
changeset
|
590 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
|
591 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
|
592 if (compare_versions (forge_pkg_version, installed_pkg_version, ">")) |
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
593 feval (@pkg, "install", "-forge", installed_pkg_name); |
18556
4daf647c86c3
Implement pkg update pkgnametoupdate (Bug #41732)
John Donoghue <john.donoghue@ieee.org>
parents:
17744
diff
changeset
|
594 endif |
20475
7fa1970a655d
pkg.m: drop check of nargout value, the interpreter already does that.
Carnë Draug <carandraug@octave.org>
parents:
19833
diff
changeset
|
595 endfor |
12778
0ca5672d5f1a
Implement pkg update command
Lukas Reichlin <lukas.reichlin@gmail.com>
parents:
12710
diff
changeset
|
596 |
6496 | 597 otherwise |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20708
diff
changeset
|
598 error ("pkg: invalid action. See 'help pkg' for available actions"); |
6496 | 599 endswitch |
19187 | 600 |
6496 | 601 endfunction |