# HG changeset patch # User jwe # Date 1147369422 0 # Node ID 653405a3af98dd00fe7b52cb7315dbe5e538cf75 # Parent 2ece6d7c7b5dc8d10cab0846d8610e39ebadf596 [project @ 2006-05-11 17:43:42 by jwe] diff -r 2ece6d7c7b5d -r 653405a3af98 scripts/ChangeLog --- a/scripts/ChangeLog Thu May 11 07:00:19 2006 +0000 +++ b/scripts/ChangeLog Thu May 11 17:43:42 2006 +0000 @@ -2,8 +2,7 @@ * pkg/Makefile.in: New file. * configure.in (AC_CONFIG_FILES): Add pkg/Makefile to the list. - - * path/genpath.m: New file. + * Makefile.in (SUBDIRS): Add pkg to the list. 2006-05-10 John W. Eaton diff -r 2ece6d7c7b5d -r 653405a3af98 scripts/Makefile.in --- a/scripts/Makefile.in Thu May 11 07:00:19 2006 +0000 +++ b/scripts/Makefile.in Thu May 11 17:43:42 2006 +0000 @@ -30,7 +30,7 @@ skip-autoheader DOCSTRINGS SUBDIRS = audio control deprecated elfun finance general image io \ - linear-algebra miscellaneous optimization path plot polynomial \ + linear-algebra miscellaneous optimization path pkg plot polynomial \ quaternion set signal sparse specfun special-matrix startup \ statistics strings testfun time diff -r 2ece6d7c7b5d -r 653405a3af98 scripts/path/genpath.m --- a/scripts/path/genpath.m Thu May 11 07:00:19 2006 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -## Copyright (C) 2006 John W. Eaton -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, write to the Free -## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. - -## -*- texinfo -*- -## @deftypefn {Built-in Function} {} genpath (@var{dir}) -## Return a path constructed from @var{dir} and all its subdiretories. -## @end deftypefn - -function retval = genpath (dirname) - - if (nargin == 1) - s = stat (dirname); - if (S_ISDIR (s.mode)) - lst = __genpath__ (dirname); - lst{2,:} = pathsep (); - lst{2,end} = ""; - retval = strcat (lst{:}); - else - retval = ""; - endif - else - print_usage ("genpath"); - endif - -endfunction - -function retval = __genpath__ (dirname) - - retval = {dirname}; - - s = dir (dirname); - n = length (s); - for i = 1:n - elt = s(i); - nm = elt.name; - if (elt.isdir && ! (strcmp (nm, ".") || strcmp (nm, ".."))) - ## FIXME -- Octave bug: recursion fails here if the __genpath__ - ## call is moved inside the []. - tmp = __genpath__ (fullfile (dirname, nm)); - retval = [retval, tmp]; - endif - endfor - -endfunction