# HG changeset patch # User dbateman # Date 1156585133 0 # Node ID 51684d05b4bf7f449ba7f423fa79fd1cb6e555db # Parent 3cbefe88edc6bdd97532b6aaf2b186e4151e34ac [project @ 2006-08-26 09:36:44 by dbateman] diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2006-08-26 David Bateman + + * pkg/pkg.m (install, uninstall, installed_packages): Allow for + absence of trailing "/" in OCTAVE_HOME. + 2006-08-25 Alexander Barth * time/datenum.m: Allow arg to be character string. diff --git a/scripts/pkg/pkg.m b/scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -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;