changeset 5974:51684d05b4bf

[project @ 2006-08-26 09:36:44 by dbateman]
author dbateman
date Sat, 26 Aug 2006 09:38:53 +0000
parents 3cbefe88edc6
children e64059303a6f
files scripts/ChangeLog scripts/pkg/pkg.m
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog
+++ b/scripts/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-26  David Bateman <dbateman@free.fr>
+
+	* pkg/pkg.m (install, uninstall, installed_packages): Allow for
+	absence of trailing "/" in OCTAVE_HOME.
+
 2006-08-25  Alexander Barth  <abarth@marine.usf.edu>
 
 	* time/datenum.m: Allow arg to be character string.
--- 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;