changeset 6683:a2f697dca2a4

[project @ 2007-06-01 23:10:24 by dbateman]
author dbateman
date Fri, 01 Jun 2007 23:10:56 +0000
parents 1e440ccda1ca
children 39e34c15f222
files scripts/ChangeLog scripts/pkg/pkg.m
diffstat 2 files changed, 21 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Jun 01 19:34:56 2007 +0000
+++ b/scripts/ChangeLog	Fri Jun 01 23:10:56 2007 +0000
@@ -1,3 +1,10 @@
+2007-06-01  David Bateman  <dbateman@free.fr>
+
+	* pkg.m (pkg:is_superuser): Remove function used in one place and
+	incorporate into main pkg function.
+	(pkg:install): Check for existence of files to install before
+	globbing and warn the user if they don't exist.
+
 2007-05-31  David Bateman  <dbateman@free.fr>
 
 	* miscellaneous/copyfile.m: Split copying of multiple files to a 
--- a/scripts/pkg/pkg.m	Fri Jun 01 19:34:56 2007 +0000
+++ b/scripts/pkg/pkg.m	Fri Jun 01 23:10:56 2007 +0000
@@ -178,7 +178,12 @@
 				     "octave_packages");
   mlock ();
 
-  global_install = issuperuser ();
+  if (ispc () && ! isunix ())
+    global_install = 1;
+  else
+    global_install = (geteuid() == 0);
+  endif
+
   if (prefix == -1)
     if (global_install)
       prefix = fullfile (OCTAVE_HOME (), "share", "octave", "packages");
@@ -464,6 +469,14 @@
   ## Uncompress the packages and read the DESCRIPTION files
   tmpdirs = packdirs = descriptions = {};
   try
+
+    ## Warn about non existent files 
+    for i = 1:length (files)
+      if (isempty (glob(files{i}))) 
+	warning ("file %s does not exist", files{i});
+      endif
+    endfor
+
     ## Unpack the package files and read the DESCRIPTION files
     files = glob (files);
     packages_to_uninstall = [];
@@ -531,8 +544,6 @@
 	    endif
 	  endfor
 	endfor        
-      else
-	warning ("file %s does not exist", tgz);
       endif
     endfor
   catch
@@ -1242,15 +1253,6 @@
   endif
 endfunction
 
-function out = issuperuser ()
-  if (ispc () && ! isunix ())
-    out = 1;
-  else
-    ## Need to be a bit presistent in probing superuser
-    out = (geteuid() == 0);
-  endif
-endfunction
-
 ## This function makes sure the package contains the
 ## essential files.
 function verify_directory (dir)