Mercurial > octave
annotate scripts/miscellaneous/private/__w2mpth__.m @ 29358:0a5b15007766 stable
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2021.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2021 09:52:15 -0500 |
parents | 9f9ac219896d |
children | 796f54d4ddbf |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27985
diff
changeset
|
3 ## Copyright (C) 2016-2021 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
7 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## (at your option) any later version. |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
14 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
19 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
25 |
20181
aa36fb998a4d
maint: Remove unnecessary whitespace at end of lines.
Rik <rik@octave.org>
parents:
19978
diff
changeset
|
26 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
20726
diff
changeset
|
27 ## @deftypefn {} {@var{mingwpath} =} __w2mpth__ (@var{winpath}) |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
28 ## Convert a Windows-style relative or full path name to MinGW style. |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
29 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
30 ## @strong{Caution:} __w2mpth__ does not check the validity of the path. |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
31 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
32 ## Examples: |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
33 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
34 ## @example |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
35 ## @group |
19978 | 36 ## mpth = __w2mpth__ ('D:\full\path\to\file.dat') |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
37 ## @result{} '/D/full/path/to/file.dat' |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
38 ## @end group |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
39 ## @end example |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
40 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
41 ## @example |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
42 ## @group |
19978 | 43 ## mpth = __w2mpth__ ('relative\path\to\file.dat') |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
44 ## @result{} 'relative/path/to/file.dat' |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
45 ## @end group |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
46 ## @end example |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
47 ## |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
48 ## @end deftypefn |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
49 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
50 function mingwpath = __w2mpth__ (winpath) |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
51 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
52 ## Check for platform |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
53 if (! ispc) |
20726
25d676f9619c
Preface error() messages with name of function when possible.
Rik <rik@octave.org>
parents:
20181
diff
changeset
|
54 error ("__w2mpth__: function must only be called on Windows platforms\n"); |
19951
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
55 endif |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
56 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
57 ## Replace backslash file separators by forward slashes |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
58 mingwpath = strrep (winpath, '\', '/'); |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
59 ## Also treat drive letter but beware of relative filenames |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
60 mingwpath = regexprep (mingwpath, '^([a-zA-Z]):', '/$1'); |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
61 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
62 endfunction |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
63 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
64 |
8c20fb6caa16
Fix XFAIL with tar and unpack tests (bug #44007, bug #43979).
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
diff
changeset
|
65 ## Use single quote strings for winpaths to cope with backslashes. |
19975
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
66 ## These tests are commented out until a better place is found (bug #44581) |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
67 ##%!test |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
68 ##%! if (ispc) |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
69 ##%! assert (__w2mpth__ ('file.fil'), 'file.fil'); |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
70 ##%! assert (__w2mpth__ ('\file.fil'), '/file.fil'); |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
71 ##%! assert (__w2mpth__ ('G:\file.fil'), '/G/file.fil'); |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
72 ##%! assert (__w2mpth__ ('r:\subdir\file.fil'), '/r/subdir/file.fil'); |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
73 ##%! assert (__w2mpth__ ('relative\path\to\file.dat'), |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
74 ##%! 'relative/path/to/file.dat') |
0f2cbcb14a21
scripts/miscellaneous/private/__w2mpth__.m: comment out tests (bug #44581)
Philip Nienhuis <prnienhuis@users.sf.net>
parents:
19951
diff
changeset
|
75 ##%! endif |