Navigation

Operators and Keywords

Function List:

C++ API

pkg.m File Reference


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)

Function Documentation

id auto (  )  [virtual]

elseif ( verbose   ) 

elseif ( nargout  = = 1  ) 

else error ( "Can not find the command shell"    ) 

error ( "'make' returned the following error: %s"  ,
output   
)

error ( "the configure script returned the following error: %s"  ,
output   
)

else error ( "too many output arguments requested"   ) 

else error ( "more than one action specified"   ) 

ext ( end   ) 

id false (  )  [virtual]

if ( pos   ) 

if ( ext(end)  = ="*"  ) 

endif endif if ( isempty(find(idx==i))   ) 

if ( (length(deps) > 1)||(length(deps)==1 &&!strcmp(deps{1}.package,"octave"))   ) 

else if ( handle_deps   ) 

endif if ( strcmpEXEC_PATH, execpath  ) 

endif endif endfor if ( length(dirs ,
 
)

if ( exist(tmpdir,"dir")   ) 

if ( exist(fullfile(dirs{end},"bin"),"dir")   ) 

endif endfor endfor if ( isemptytmpdesc  )  [new]

if ( isempty(deps)||(length(deps)==1 &&strcmp(deps{1}.package,"octave"))   )  [new]

endif endif if ( have_sh   ) 

if ( exist(files,"file")   ) 

endif endif if ( exist(fullfile(src,"Makefile"),"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 install if ( length(files = =0  ) 

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 (  ) 

endif endfor endfor newdesc ( idx   ) 

endswitch endfor switch ( action   ) 

id true (  )  [virtual]

endif uninstall ( files  ,
deps  ,
verbose  ,
local_list  ,
global_list  ,
global_install   
)

endif unload_packages ( files  ,
deps  ,
local_list  ,
global_list   
)


Variable Documentation

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]

Initial value:

 pkg (varargin)

  persistent user_prefix = false

global_install = issuperuser ()

persistent global_list

Initial value:

 fullfile (OCTAVE_HOME (), "share", "octave",
                                     "octave_packages")

Initial value:

 installed_packages (local_list,
                                                                global_list)

if (fid < 0) error ("couldn't open %s else have_sh = true

for i

Initial value:

 1:length (varargin)
    switch (varargin{i})
      case "-nodeps"
        deps = false

endif endfor endfor idx = []

instdir = fullfile (packdir, "inst")

else isglob = false

for k

Initial value:

 1 : length (deps)
        for j = 1 : length (desc)
          if (strcmp (desc{j}.name, deps{k}.package))
            tmpdesc{end+1} = desc{j}

case load all or auto when calling pkg load

persistent local_list = tilde_expand (fullfile ("~", ".octave_packages"))

msg = fopen (files, "r")

ndir = installed_pkgs_lst{i}.dir

Initial value:

 save_order (desc)
  newdesc = {}

Initial value:

 shell (cstrcat ("export INSTALLDIR=\"", desc.dir,
                                         "\"; make -C '", src, "'"))

endif pos = findstr (nm, ext)

endif prefix = -1

else tmpdesc = desc{i} {}

endif tmpdir = getarchdir (installed_pkgs_lst{i})

verbose = false