# HG changeset patch # User Thomas Weber # Date 1205090922 -3600 # Node ID e12d15c8beb3d1de9b166c6957a84fd82b989a7e # Parent 85da2ab0c6fd626a891fdcb9185ba2d80f96ca0e pkg.m accepts extracted packages for installation diff -r 85da2ab0c6fd -r e12d15c8beb3 scripts/ChangeLog --- a/scripts/ChangeLog Fri Mar 07 20:17:54 2008 -0500 +++ b/scripts/ChangeLog Sun Mar 09 20:28:42 2008 +0100 @@ -1,3 +1,7 @@ 2008-03-07 John W. Eaton + + * pkg/pkg.m: Accepts already extracted packages for installation. + 2008-03-07 John W. Eaton * plot/contourf.m: Set axes layer property to "top". diff -r 85da2ab0c6fd -r e12d15c8beb3 scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Fri Mar 07 20:17:54 2008 -0500 +++ b/scripts/pkg/pkg.m Sun Mar 09 20:28:42 2008 +0100 @@ -599,10 +599,23 @@ function install (files, handle_deps, au if (length (dirlist) > 3) error ("bundles of packages are not allowed") endif + endif + ## The filename pointed to an uncompressed package to begin with + if (exist (tgz, "dir")) + dirlist = {".", "..", tgz}; + endif + + if (exist (tgz, "file") || exist (tgz, "dir")) ## the two first entries of dirlist are "." and ".." for k = 3:length (dirlist) - packdir = fullfile (tmpdir, dirlist{k}); + ## FIXME: Does this loop make sense? + ## FIXME: If length(dirlist) > 3, we already broke out earlier, didn't we? + if (exist (tgz, "file")) + packdir = fullfile (tmpdir, dirlist{k}); + else + packdir = fullfile (pwd(), dirlist{k}); + endif packdirs{end+1} = packdir; ## Make sure the package contains necessary files