# HG changeset patch # User dbateman # Date 1180739456 0 # Node ID a2f697dca2a4179709a005237e8485e5f3d16c59 # Parent 1e440ccda1caf936a338573a3614215e53c4c832 [project @ 2007-06-01 23:10:24 by dbateman] diff -r 1e440ccda1ca -r a2f697dca2a4 scripts/ChangeLog --- 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 + + * 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 * miscellaneous/copyfile.m: Split copying of multiple files to a diff -r 1e440ccda1ca -r a2f697dca2a4 scripts/pkg/pkg.m --- 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)