# HG changeset patch # User jwe # Date 1172589515 0 # Node ID 0d41cafd2e0dd0835ff2dab230705d5464334478 # Parent e5227a46343d83999abe57b537acc011ac58f194 [project @ 2007-02-27 15:18:35 by jwe] diff -r e5227a46343d -r 0d41cafd2e0d scripts/ChangeLog --- a/scripts/ChangeLog Tue Feb 27 15:12:25 2007 +0000 +++ b/scripts/ChangeLog Tue Feb 27 15:18:35 2007 +0000 @@ -1,3 +1,7 @@ +2007-02-27 From Michael Goffioul + + * pkg/pkg.m: Use fullfile to create filenames from parts. + 2007-02-26 From Michael Goffioul * Makefile.in, audio/Makefile.in, control/Makefile.in, diff -r e5227a46343d -r 0d41cafd2e0d scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Tue Feb 27 15:12:25 2007 +0000 +++ b/scripts/pkg/pkg.m Tue Feb 27 15:18:35 2007 +0000 @@ -127,15 +127,15 @@ function [local_packages, global_packages] = pkg(varargin) ## Installation prefix (XXX: what should these be on windows?) persistent prefix = -1; - persistent local_list = tilde_expand("~/.octave_packages"); - persistent global_list = fullfile (OCTAVE_HOME (), "/share/octave/octave_packages"); + persistent local_list = tilde_expand(fullfile("~", ".octave_packages")); + persistent global_list = fullfile (OCTAVE_HOME (), "share", "octave", "octave_packages"); mlock; if (prefix == -1) if (issuperuser()) - prefix = fullfile (OCTAVE_HOME (), "/share/octave/packages"); + prefix = fullfile (OCTAVE_HOME (), "share", "octave", "packages"); else - prefix = "~/octave"; + prefix = fullfile ("~", "octave"); endif endif prefix = tilde_expand(prefix); @@ -203,7 +203,7 @@ local_packages = prefix; elseif (length(files) == 1 && nargout == 0 && ischar(files{1})) prefix = files{1}; - #if (!strcmp(prefix(end), "/")) prefix(end+1) = "/"; endif + #if (!strcmp(prefix(end), filesep)) prefix(end+1) = filesep; endif else error("You must specify a prefix directory, or request an output argument"); endif @@ -605,7 +605,7 @@ function prepare_installation(desc, packdir) ## Is there a pre_install to call? - if (exist([packdir "pre_install.m"], "file")) + if (exist(fullfile(packdir, "pre_install.m"), "file")) wd = pwd(); try cd(packdir); @@ -618,8 +618,9 @@ endif ## If the directory "inst" doesn't exist, we create it - if (!exist([packdir "inst"], "dir")) - [status, msg] = mkdir([packdir "inst"]); + inst_dir = fullfile(packdir, "inst"); + if (!exist(inst_dir, "dir")) + [status, msg] = mkdir(inst_dir); if (status != 1) rm_rf(desc.dir); error("The 'inst' directory did not exist and could not be created: %s", msg);