diff scripts/pkg/pkg.m @ 6683:a2f697dca2a4

[project @ 2007-06-01 23:10:24 by dbateman]
author dbateman
date Fri, 01 Jun 2007 23:10:56 +0000
parents f938c7018d28
children 44ebfc8c4ff0
line wrap: on
line diff
--- a/scripts/pkg/pkg.m
+++ b/scripts/pkg/pkg.m
@@ -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)