annotate scripts/miscellaneous/untar.m @ 12312:b10ea6efdc58 release-3-4-x ss-3-3-91

version is now 3.3.91
author John W. Eaton <jwe@octave.org>
date Mon, 31 Jan 2011 08:36:58 -0500
parents c792872f8942
children 8f2056646dba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11523
fd0a3ac60b0e update copyright notices
John W. Eaton <jwe@octave.org>
parents: 11469
diff changeset
1 ## Copyright (C) 2005-2011 S�ren Hauberg
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
2 ##
6049
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
3 ## This file is part of Octave.
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
4 ##
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6599
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6599
diff changeset
8 ## your option) any later version.
6049
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
9 ##
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
13 ## General Public License for more details.
04c2ad6d1679 [project @ 2006-10-13 14:32:15 by jwe]
jwe
parents: 6041
diff changeset
14 ##
5807
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6599
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6599
diff changeset
17 ## <http://www.gnu.org/licenses/>.
5807
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
18
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
6248
7fad1fad19e1 [project @ 2007-01-22 17:28:17 by jwe]
jwe
parents: 6082
diff changeset
20 ## @deftypefn {Function File} {} untar (@var{tarfile}, @var{dir})
5808
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
21 ## Unpack the TAR archive @var{tarfile} to the directory @var{dir}.
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
22 ## If @var{dir} is not specified, it defaults to the current directory.
8297
dc62132651db doc fixes
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
23 ## @seealso{unpack, bunzip2, tar, gzip, gunzip, zip, unzip}
5807
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
24 ## @end deftypefn
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
25
5808
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
26 ## Author: S�ren Hauberg <hauberg@gmail.com>
6081
cd98c1e18d48 [project @ 2006-10-25 03:36:45 by jwe]
jwe
parents: 6049
diff changeset
27 ## Adapted-By: jwe, Bill Denney
5808
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
28
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 8920
diff changeset
29 function varargout = untar (tarfile, dir = ".")
5808
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
30
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 8920
diff changeset
31 if (nargin != 1 && nargin != 2)
6081
cd98c1e18d48 [project @ 2006-10-25 03:36:45 by jwe]
jwe
parents: 6049
diff changeset
32 print_usage ();
5808
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
33 endif
a18d85bdff31 [project @ 2006-05-11 03:11:03 by jwe]
jwe
parents: 5807
diff changeset
34
6599
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
35 if (nargout > 0)
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
36 varargout = cell (1, nargout);
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 8920
diff changeset
37 [varargout{:}] = unpack (tarfile, dir, mfilename ());
6599
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
38 else
11469
c776f063fefe Overhaul m-script files to use common variable name between code and documentation.
Rik <octave@nomad.inbox5.com>
parents: 8920
diff changeset
39 unpack (tarfile, dir, mfilename ());
6599
08ca72d6ffc9 [project @ 2007-04-28 22:47:29 by jwe]
jwe
parents: 6248
diff changeset
40 endif
6081
cd98c1e18d48 [project @ 2006-10-25 03:36:45 by jwe]
jwe
parents: 6049
diff changeset
41
5807
29c4fb42b210 [project @ 2006-05-11 01:48:56 by jwe]
jwe
parents:
diff changeset
42 endfunction