Mercurial > octave
diff scripts/pkg/pkg.m @ 5974:51684d05b4bf
[project @ 2006-08-26 09:36:44 by dbateman]
author | dbateman |
---|---|
date | Sat, 26 Aug 2006 09:38:53 +0000 |
parents | 9cc8149f81b0 |
children | b1a1c10bf2fd |
line wrap: on
line diff
--- a/scripts/pkg/pkg.m Sat Aug 26 03:12:45 2006 +0000 +++ b/scripts/pkg/pkg.m Sat Aug 26 09:38:53 2006 +0000 @@ -85,7 +85,11 @@ ## Set parameters depending on wether or not the installation ## is system-wide (global) or local. local_list = tilde_expand("~/.octave_packages"); - global_list = [OCTAVE_HOME "share/octave/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 OCTAVE_PACKAGE_PREFIX; prefix_exist = (length(OCTAVE_PACKAGE_PREFIX) != 0 && ischar(OCTAVE_PACKAGE_PREFIX)); @@ -329,7 +333,11 @@ function uninstall(pkgnames, handle_deps) local_list = tilde_expand("~/.octave_packages"); - global_list = [OCTAVE_HOME "share/octave/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 ## Get the list of installed packages [local_packages, global_packages] = installed_packages(); if (issuperuser()) @@ -948,7 +956,11 @@ function [out1, out2] = installed_packages() local_list = tilde_expand("~/.octave_packages"); - global_list = [OCTAVE_HOME "share/octave/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 ## Get the list of installed packages try local_packages = load(local_list).local_packages;