Mercurial > hg > octave-lyh
changeset 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 |
files | scripts/ChangeLog scripts/pkg/pkg.m |
diffstat | 2 files changed, 8 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2006-10-04 John W. Eaton <jwe@octave.org> + + * pkg/pkg.m: Use fullfile to concatenate directory and file names. + 2006-10-04 Søren Hauberg <soren@hauberg.org> * pkg/pkg.m: Update docs.
--- 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;