Functions | |
mlock () | |
if (prefix==-1) if(global_install) prefix | |
if (length(varargin)==0||!iscellstr(varargin)) print_usage() | |
id | auto () |
id | true () |
id | false () |
if (!user_prefix) prefix | |
endif case available_actions | if (strcmp(action,"none")) action |
else | error ("more than one action specified") |
endswitch endfor | switch (action) case"list"if(nargout |
elseif (nargout==1) local_packages | |
else | error ("too many output arguments requested") |
endif case install | if (length(files)==0) error("you must specify at least one filename when calling 'pkg install'") |
endif | install (files, deps, auto, prefix, archprefix, verbose, local_list, global_list, global_install) |
endif | uninstall (files, deps, verbose, local_list, global_list, global_install) |
endif | load_packages (files, deps, local_list, global_list) |
endif | unload_packages (files, deps, local_list, global_list) |
case prefix if(length(files)==0 &&nargout==0) printf("Installation prefix endif | if (isempty(getenv("CXX"))) flags |
endif | if (isempty(getenv("AR"))) flags |
endif | if (isempty(getenv("RANLIB"))) flags |
if (status!=0) rm_rf(desc.dir) | |
error ("the configure script returned the following error: %s", output) | |
elseif (verbose) printf("%s" | |
endif endif | if (exist(fullfile(src,"Makefile"),"file"))[status |
error ("'make' returned the following error: %s", output) | |
if (exist(files,"file"))[fid | |
endif endif | if (have_sh)[status |
else | error ("Can not find the command shell") endif else[status |
if (isempty(deps)||(length(deps)==1 &&strcmp(deps{1}.package,"octave"))) new desc | |
endif endfor endfor | if (!isempty(tmpdesc)) new desc |
endif endfor endfor | newdesc (idx) |
endfunction function | load_packages_and_dependencies (idx, handle_deps, installed_pkgs_lst, global_install) idx |
if (exist(fullfile(dirs{end},"bin"),"dir")) execpath | |
if (exist(tmpdir,"dir")) dirs | |
endif endif endfor | if (length(dirs) > 0) addpath(dirs |
endif | if (!strcmp(EXEC_PATH, execpath)) EXEC_PATH(execpath) |
else | if (handle_deps) deps |
if ((length(deps) > 1)||(length(deps)==1 &&!strcmp(deps{1}.package,"octave"))) tmplidx | |
endif endif | if (isempty(find(idx==i))) idx(end+1) |
if (ext(end)=="*") isglob | |
ext (end) | |
if (pos) if(!isglob &&(length(nm)-pos(end)! | |
Variables | |
function [local_packages, global_packages] | |
persistent | prefix = -1 |
persistent | archprefix = -1 |
persistent | local_list = tilde_expand (fullfile ("~", ".octave_packages")) |
persistent | global_list |
global_install = issuperuser () | |
endif | available_actions |
endif | files = {} |
deps = true | |
auto = 0 | |
action = "none" | |
verbose = false | |
for | i |
global_packages | |
case load all or auto when calling pkg | load |
endif [status, output] | |
output | |
instdir = fullfile (packdir, "inst") | |
archdir = fullfile (packdir, "inst", getarch ()) | |
msg = fopen (files, "r") | |
if(fid< 0) error("couldn't open %s else | have_sh = true |
endif endfunction function | newdesc |
else | tmpdesc = desc{i} {} |
for | k |
break | |
endif endif endfor | idx = [] |
dirs = {} | |
execpath = EXEC_PATH () | |
ndir = installed_pkgs_lst{i}.dir | |
endif | tmpdir = getarchdir (installed_pkgs_lst{i}) |
endif endif endfor endfunction function | dep |
else | isglob = false |
endif | pos = findstr (nm, ext) |
id auto | ( | ) | [virtual] |
elseif | ( | verbose | ) |
elseif | ( | nargout | = = 1 |
) |
error | ( | "'make' returned the following error: %s" | , | |
output | ||||
) |
error | ( | "the configure script returned the following error: %s" | , | |
output | ||||
) |
ext | ( | end | ) |
id false | ( | ) | [virtual] |
if | ( | pos | ) |
if | ( | ext(end) | = ="*" |
) |
else if | ( | handle_deps | ) |
endif if | ( | ! | strcmpEXEC_PATH, execpath | ) |
if | ( | exist(tmpdir,"dir") | ) |
if | ( | exist(files,"file") | ) |
if | ( | status! | = 0 |
) |
endif if | ( | isempty(getenv("RANLIB")) | ) |
endif if | ( | isempty(getenv("AR")) | ) |
case prefix if (length (files) == 0 && nargout == 0) printf ("Installation prefix endif if | ( | isempty(getenv("CXX")) | ) |
endif case available_actions if | ( | strcmp(action,"none") | ) |
if | ( | ! | user_prefix | ) |
if | ( | length(varargin) | = =0||!iscellstr(varargin) |
) |
if | ( | prefix | = =-1 |
) |
endif install | ( | files | , | |
deps | , | |||
auto | , | |||
prefix | , | |||
archprefix | , | |||
verbose | , | |||
local_list | , | |||
global_list | , | |||
global_install | ||||
) |
endif load_packages | ( | files | , | |
deps | , | |||
local_list | , | |||
global_list | ||||
) |
endfunction function load_packages_and_dependencies | ( | idx | , | |
handle_deps | , | |||
installed_pkgs_lst | , | |||
global_install | ||||
) |
mlock | ( | ) |
id true | ( | ) | [virtual] |
endif uninstall | ( | files | , | |
deps | , | |||
verbose | , | |||
local_list | , | |||
global_list | , | |||
global_install | ||||
) |
endif unload_packages | ( | files | , | |
deps | , | |||
local_list | , | |||
global_list | ||||
) |
action = "none" |
archdir = fullfile (packdir, "inst", getarch ()) |
archprefix = -1 |
endif auto = 0 |
Initial value:
{"list", "install", "uninstall", "load", ... "unload", "prefix", "local_list", ... "global_list", "rebuild", "build","describe"}
break |
Initial value:
is_architecture_dependent (nm) persistent archdepsuffix = {".oct",".mex",".a",".lib",".so",".so.*",".dll","dylib"}
deps = true |
dirs = {} |
Initial value:
shell (strcat ("cd '", src, "'; ./configure --prefix=\"", desc.dir, "\"", flags))
function[local_packages, global_packages] |
global_install = issuperuser () |
persistent global_list |
Initial value:
fullfile (OCTAVE_HOME (), "share", "octave", "octave_packages")
Initial value:
installed_packages (local_list, global_list)
instdir = fullfile (packdir, "inst") |
persistent local_list = tilde_expand (fullfile ("~", ".octave_packages")) |
endif endfunction function newdesc |
endif pos = findstr (nm, ext) |
verbose = false |