# HG changeset patch # User jwe # Date 1159989188 0 # Node ID 37f878fb9d5440811876d21ff456d01719dd875f # Parent 93e8ca2aff57492561bba42d240a021c92047f83 [project @ 2006-10-04 19:13:08 by jwe] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2006-10-04 John W. Eaton + + * pkg/pkg.m: Use fullfile to concatenate directory and file names. + 2006-10-04 Søren Hauberg * pkg/pkg.m: Update docs. diff --git a/scripts/pkg/pkg.m b/scripts/pkg/pkg.m --- 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;