octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Allow installation of extracted packages with pkg.m


From: John W. Eaton
Subject: Allow installation of extracted packages with pkg.m
Date: Sun, 23 Mar 2008 11:49:54 -0400

On  9-Mar-2008, Thomas Weber wrote:

| The attached changeset allows the installation of already extracted
| tarballs. It hooks into the normal installation process, just after the
| extraction.
| 
| There's a FIXME comment in the patch, as I don't understand the
| necessity for the 
|   from k=3: length(dirlist)
| loop. If you look at the unchanged code, length(dirlist) is checked to be not 
>3
| just before this loop.

Yes, the loop looks like it can only execute once since dirlist at
this point could not be greater than three.

| By the way, I think a dummy pkg inside the Octave sources for testing
| pkg.m would make sense (to have meaningfull diffs, it would be tarred up
| as part of the unit testing). 

That would probably be useful.  Would someone like to submit a patch
to add it?

| # HG changeset patch
| # User Thomas Weber <address@hidden>
| # 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  <address@hidden
| +2008-03-09  Thomas Weber  <address@hidden>
| +
| +     * pkg/pkg.m: Accepts already extracted packages for installation.
| +
|  2008-03-07  John W. Eaton  <address@hidden>
|  
|       * 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

Why are you adding this endif?  It seems it would not match anything.

| +      ## 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

I don't know pkg.m very well, so it would help me if someone who does
could comment on this patch.  If the above is generally OK and the
loop is not needed, then please resubmit the patch with the loop
removed.  Also please explain the apparently stray "endif".

Thanks,

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]