changeset 6049:04c2ad6d1679

[project @ 2006-10-13 14:32:15 by jwe]
author jwe
date Fri, 13 Oct 2006 14:32:23 +0000
parents 53e42cafb94a
children 435294ca4ee6
files ChangeLog configure.in scripts/ChangeLog scripts/miscellaneous/tar.m scripts/miscellaneous/untar.m scripts/miscellaneous/unzip.m scripts/miscellaneous/zip.m scripts/plot/sombrero.m
diffstat 8 files changed, 141 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Oct 11 19:23:04 2006 +0000
+++ b/ChangeLog	Fri Oct 13 14:32:23 2006 +0000
@@ -1,3 +1,10 @@
+2006-10-12  John W. Eaton  <jwe@octave.org>
+
+	* configure.in (AH_BOTTOM): Don't unconditionally #define
+	OCTAVE_HAVE_POSIX_FILESYSTEM followed by a conditional #undef
+	OCTAVE_HAVE_POSIX_FILESYSTEM since autoconf is commenting out the
+	#undef.
+
 2006-10-09  John W. Eaton  <jwe@octave.org>
 
 	* Makeconf.in (CURL_LIBS, do-subst-config-vals):
--- a/configure.in	Wed Oct 11 19:23:04 2006 +0000
+++ b/configure.in	Fri Oct 13 14:32:23 2006 +0000
@@ -29,7 +29,7 @@
 EXTERN_CXXFLAGS="$CXXFLAGS"
 
 AC_INIT
-AC_REVISION($Revision: 1.524 $)
+AC_REVISION($Revision: 1.525 $)
 AC_PREREQ(2.57)
 AC_CONFIG_SRCDIR([src/octave.cc])
 AC_CONFIG_HEADER(config.h)
@@ -1702,16 +1702,13 @@
 typedef int sig_atomic_t;
 #endif
 
-#define OCTAVE_HAVE_POSIX_FILESYSTEM 1
-
 #if defined (__WIN32__) && ! defined (__CYGWIN__)
 #define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1
-#undef OCTAVE_HAVE_POSIX_FILESYSTEM
-#endif
-
-#if defined (__CYGWIN__)
+#elif defined (__CYGWIN__)
 #define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1
 #define OCTAVE_HAVE_POSIX_FILESYSTEM 1
+#else
+#define OCTAVE_HAVE_POSIX_FILESYSTEM 1
 #endif
 
 /* Define if we expect to have <windows.h>, Sleep, etc. */
--- a/scripts/ChangeLog	Wed Oct 11 19:23:04 2006 +0000
+++ b/scripts/ChangeLog	Fri Oct 13 14:32:23 2006 +0000
@@ -1,3 +1,7 @@
+2006-10-12  Quentin Spencer  <qspencer@ieee.org>
+
+	* plot/sombrero.m: Only plot if nargout == 0.  Otherwise, return data.
+
 2006-10-10  John W. Eaton  <jwe@octave.org>
 
 	* miscellaneous/copyfile.m, miscellaneous/movefile.m: New functions.
--- a/scripts/miscellaneous/tar.m	Wed Oct 11 19:23:04 2006 +0000
+++ b/scripts/miscellaneous/tar.m	Fri Oct 13 14:32:23 2006 +0000
@@ -1,18 +1,21 @@
 ## Copyright (C) 2005 Søren Hauberg
 ## 
-## This program 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 of the License, or
-## (at your option) any later version.
-## 
-## This program 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.
-## 
+## 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 this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+## 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 {Function File} {@var{entries} =} tar (@var{tarfile}, @var{files}, @var{root})
--- a/scripts/miscellaneous/untar.m	Wed Oct 11 19:23:04 2006 +0000
+++ b/scripts/miscellaneous/untar.m	Fri Oct 13 14:32:23 2006 +0000
@@ -1,18 +1,21 @@
 ## Copyright (C) 2005 Søren Hauberg
 ## 
-## This program 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 of the License, or
-## (at your option) any later version.
-## 
-## This program 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.
-## 
+## 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 this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+## 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 {Function File} untar (@var{tarfile}, @var{dir})
--- a/scripts/miscellaneous/unzip.m	Wed Oct 11 19:23:04 2006 +0000
+++ b/scripts/miscellaneous/unzip.m	Fri Oct 13 14:32:23 2006 +0000
@@ -1,18 +1,21 @@
 ## Copyright (C) 2005 Søren Hauberg
 ## 
-## This program 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 of the License, or
-## (at your option) any later version.
-## 
-## This program 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.
-## 
+## 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 this program; if not, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+## 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 {Function File} unzip (@var{zipfile}, @var{dir})
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/miscellaneous/zip.m	Fri Oct 13 14:32:23 2006 +0000
@@ -0,0 +1,77 @@
+## Copyright (C) 2006 Sylvain Pelissier
+##
+## 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 {Function File} {@var{entries} =} zip (@var{zipfile},@var{files})
+## @deftypefnx {Function File} {@var{entries} =} zip (@var{zipfile},@var{files},@var{rootdir})
+## Compress the list of files and/or directories specified in @var{files} 
+## into the archive @var{zipfiles} in the same directory. If @var{rootdir} 
+## is defined the @var{files} is located relative to @var{rootdir} rather 
+## than the current directory
+## @seealso{unzip,tar}
+## @end deftypefn
+
+## Author: Sylvain Pelissier <sylvain.pelissier@gmail.com>
+
+function entries = zip (zipfile, files, rootdir)
+
+  if (nargin != 3)
+    rootdir = "./";
+  endif
+
+  if (nargin == 2 || nargin == 3)
+    rootdir = tilde_expand (rootdir);
+
+    if (ischar (files))
+      files = cellstr (files);
+    endif
+
+    if (ischar (zipfile) && iscellstr (files))
+
+      cmd = sprintf ("cd %s; zip -r %s/%s %s", rootdir, pwd (), zipfile,
+		     sprintf (" %s", files{:}));
+
+      [status, output] = system (cmd);
+
+      if (status == 0)
+	if (nargout > 0)
+	  cmd = sprintf ("unzip -Z -1 %s", zipfile);
+	  [status, entries] = system (cmd);
+	  if (status == 0)
+	    if (entries(end) == "\n")
+	      entries(end) = [];
+	    endif
+            entries = cellstr (split (entries, "\n"))';
+	  else
+	    error ("zip: zipinfo failed with exit status = %d", status);
+	  endif
+	endif
+      else
+	error ("zip: zip failed with exit status = %d", status);
+      endif
+    
+    else
+      error ("zip: expecting all arguments to be character strings");
+    endif
+
+  else
+    print_usage ();
+  endif
+
+endfunction
--- a/scripts/plot/sombrero.m	Wed Oct 11 19:23:04 2006 +0000
+++ b/scripts/plot/sombrero.m	Fri Oct 13 14:32:23 2006 +0000
@@ -30,7 +30,7 @@
 
 ## Author: jwe
 
-function sombrero (n)
+function [x, y, z] = sombrero (n)
 
   if (nargin == 0)
     n = 41;
@@ -42,7 +42,9 @@
       [xx, yy] = meshgrid (x, y);
       r = sqrt (xx .^ 2 + yy .^ 2) + eps;
       z = sin (r) ./ r;
-      mesh (x, y, z);
+      if (nargout == 0)
+        mesh (x, y, z);
+      end
     else
       error ("sombrero: number of grid lines must be greater than 1");
     endif