Mercurial > hg > octave-lyh
diff scripts/pkg/pkg.m @ 6036:37f878fb9d54
[project @ 2006-10-04 19:13:08 by jwe]
author | jwe |
---|---|
date | Wed, 04 Oct 2006 19:13:08 +0000 |
parents | 93e8ca2aff57 |
children | b2e7bf961122 |
line wrap: on
line diff
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -94,12 +94,7 @@ persistent prefix = -1; if (prefix == -1) if (issuperuser()) - ## XXX: Is this really needed? - if (strcmp(OCTAVE_HOME()(end),"/")) - prefix = [OCTAVE_HOME "share/octave/packages/"]; - else - prefix = [OCTAVE_HOME "/share/octave/packages/"]; - endif + prefix = fullfile (OCTAVE_HOME (), "/share/octave/packages/"); else prefix = "~/octave/"; endif @@ -171,11 +166,7 @@ ## Set parameters depending on wether or not the installation ## is system-wide (global) or local. local_list = tilde_expand("~/.octave_packages"); - if (strcmp(OCTAVE_HOME()(end),"/")) - global_list = [OCTAVE_HOME "share/octave/octave_packages"]; - else - global_list = [OCTAVE_HOME "/share/octave/octave_packages"]; - endif + global_list = fullfile (OCTAVE_HOME (), "/share/octave/octave_packages"); global_install = issuperuser(); @@ -403,11 +394,7 @@ function uninstall(pkgnames, handle_deps) local_list = tilde_expand("~/.octave_packages"); - if (strcmp(OCTAVE_HOME()(end),"/")) - global_list = [OCTAVE_HOME "share/octave/octave_packages"]; - else - global_list = [OCTAVE_HOME "/share/octave/octave_packages"]; - endif + global_list = fullfile (OCTAVE_HOME (), "/share/octave/octave_packages"); ## Get the list of installed packages [local_packages, global_packages] = installed_packages(); if (issuperuser()) @@ -1037,11 +1024,7 @@ function [out1, out2] = installed_packages() local_list = tilde_expand("~/.octave_packages"); - if (strcmp(OCTAVE_HOME()(end),"/")) - global_list = [OCTAVE_HOME "share/octave/octave_packages"]; - else - global_list = [OCTAVE_HOME "/share/octave/octave_packages"]; - endif + global_list = fullfile (OCTAVE_HOME (), "/share/octave/octave_packages"); ## Get the list of installed packages try local_packages = load(local_list).local_packages;