Mercurial > forge
annotate admin/releasePKG.m @ 12671:20e8aca47b2c octave-forge
prepare for release
author | cdf |
---|---|
date | Mon, 17 Aug 2015 10:19:39 +0000 |
parents | 1c92b4b26ced |
children |
rev | line source |
---|---|
9265 | 1 %% Copyright (c) 2011 Juan Pablo Carbajal <carbajal@ifi.uzh.ch> |
2 %% | |
3 %% This program is free software: you can redistribute it and/or modify | |
4 %% it under the terms of the GNU General Public License as published by | |
5 %% the Free Software Foundation, either version 3 of the License, or | |
6 %% any later version. | |
7 %% | |
8 %% This program is distributed in the hope that it will be useful, | |
9 %% but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 %% GNU General Public License for more details. | |
12 %% | |
13 %% You should have received a copy of the GNU General Public License | |
14 %% along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | |
16 %% -*- texinfo -*- | |
17 %% @deftypefn {Function File} {[@var{pkgtar} @var{htmltar}] = } releasePKG (@var{pkgname}) | |
18 %% @deftypefnx {Function File} {[@dots{}] = } releasePKG (@var{pkgname},@var{property},@var{value},@dots{}) | |
19 %% Create files ready to release the Octave-Forge package @var{pkgname}. | |
20 %% | |
21 %% @var{property} and @var{value} are used to indicate where is the source of the | |
22 %% package. | |
23 %% @var{property} can be: | |
24 %% @table @samp | |
25 %% @item outpath | |
26 %% Is the path where the files will be created. If not provided the current working | |
27 %% directory @code{pwd()} is used. | |
28 %% | |
29 %% @item repopath | |
30 %% Is the path where the local copy of package is located. For example, to release | |
31 %% any package in @code{main} you should pass '<my-path.to-repository>/main'. | |
32 %% If not provided, the environment variable OFPATH is used (you can set it in your) | |
33 %% .octaverc variable or using @code{setenv()}). If that variable is empty, the | |
34 %% property must be provided the first time the function is called. After that | |
35 %% it creates the environment variable (but only for the current octave session) | |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
36 %% |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
37 %% @item revsys |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
38 %% Revision control system. It can be @asis{"svn"} or @asis{"hg"}(default). |
11212 | 39 %% @end table |
9265 | 40 %% @end deftypefn |
11212 | 41 |
9265 | 42 function [pkgtar htmltar] = releasePKG (pkgname, varargin) |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
43 OFPATH = getenv ('OFPATH'); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
44 use_inputP = exist ('inputParser') == 2; |
9265 | 45 |
46 if use_inputP | |
47 parser = inputParser (); | |
12608
89788e3f77db
admin: Update releasePKG.m to use inputParser from core
jpicarbajal
parents:
12545
diff
changeset
|
48 parser.addParamValue ('repopath', OFPATH , @ischar); |
89788e3f77db
admin: Update releasePKG.m to use inputParser from core
jpicarbajal
parents:
12545
diff
changeset
|
49 parser.addParamValue ('outpath', pwd (), @ischar); |
89788e3f77db
admin: Update releasePKG.m to use inputParser from core
jpicarbajal
parents:
12545
diff
changeset
|
50 parser.addParamValue ('revsys', "hg", @ischar); |
9265 | 51 |
12608
89788e3f77db
admin: Update releasePKG.m to use inputParser from core
jpicarbajal
parents:
12545
diff
changeset
|
52 parser.parse(varargin{:}); |
9265 | 53 else |
54 opt = {varargin{1:2:end}}; | |
55 val = {varargin{2:2:end}}; | |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
56 parser.Results.repopath = tilde_expand (OFPATH); |
9265 | 57 parser.Results.outpath = pwd (); |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
58 parser.Results.revsys = "hg"; |
9265 | 59 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
60 if !isempty (opt) |
9265 | 61 [tf indx] = ismember (fieldnames(parser.Results), opt); |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
62 |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
63 opt(indx(tf)) = opt(indx(tf)); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
64 val(indx(tf)) = val(indx(tf)); |
9265 | 65 for i=1:numel(opt) |
66 parser.Results.(opt{i}) = val{i}; | |
67 end | |
68 endif | |
69 | |
70 checkrepopath(parser.Results.repopath); | |
71 | |
72 end | |
73 | |
74 % Export from repo | |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
75 outpath = tilde_expand (checkpath (parser.Results.outpath)); |
9265 | 76 |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
77 pkgname_tmp = [pkgname "_tmp"]; |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
78 exported = fullfile (pwd (), pkgname_tmp); |
9265 | 79 |
80 % Repo path | |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
81 repo_path = tilde_expand (checkpath (parser.Results.repopath)); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
82 disp(['Exporting from ' repo_path]); |
9265 | 83 |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
84 % Revision control system |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
85 revsys = parser.Results.revsys; |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
86 |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
87 if strcmp (revsys,"svn") |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
88 export_call = ["svn export " fullfile(repo_path,pkgname) " " exported " --force"]; |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
89 failed = system (export_call); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
90 else |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
91 cdir = pwd (); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
92 cd (fullfile (repo_path,pkgname)); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
93 export_call = sprintf ('hg archive --exclude ".hg*" %s', exported) |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
94 failed = system (export_call); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
95 cd (cdir); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
96 clear cdir |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
97 endif |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
98 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
99 if failed |
9265 | 100 error ("Can not export.\n"); |
12545
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
101 endif |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
102 |
12545
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
103 if isempty (OFPATH) || !strcmpi(repo_path, OFPATH) |
9265 | 104 setenv('OFPATH',parser.Results.repopath); |
105 printf (["\nEnvironment variable OFPATH set to %s\n" ... | |
106 'add setenv("OFPATH","%s");' ... | |
107 'to your .octaverc to make it permanent.' "\n\n"], ... | |
108 parser.Results.repopath, parser.Results.repopath); | |
109 fflush (stdout); | |
12545
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
110 endif |
9265 | 111 |
112 printf("Exported to %s\n", exported); | |
113 fflush(stdout); | |
114 | |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
115 %%% Directory setup and cleanup |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
116 confirm_recursive_rmdir (0, "local"); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
117 |
12545
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
118 % Make sure proper structure of archived/exported package |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
119 find_call = sprintf ("find %s -name inst", exported); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
120 [~, tmp] = system (find_call); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
121 tmp = strsplit (tmp, filesep()); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
122 |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
123 if !strcmp (tmp{end-1},pkgname_tmp) |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
124 tmp = fullfile (filesep(),tmp{2:end-1}); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
125 exported_tmp = tmpnam (); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
126 mv_call = sprintf ("mv -f -T %s %s", tmp, exported_tmp); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
127 system (mv_call); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
128 |
12545
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
129 if !rmdir (exported, "s") |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
130 error ("Couldn't erase folder"); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
131 endif |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
132 mv_call = sprintf ("mv %s %s", exported_tmp,exported); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
133 system (mv_call); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
134 rmdir (exported_tmp,"s"); |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
135 clear exported_tmp |
8e1821d0d8a7
releasePKG: improving checks of package structure
jpicarbajal
parents:
12386
diff
changeset
|
136 endif |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
137 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
138 % Run bootstrap if found |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
139 if has_dir ("src", exported) |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
140 ndir = fullfile (exported,"src"); |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
141 if has_file ("bootstrap", ndir) |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
142 odir = pwd (); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
143 cd (ndir); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
144 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
145 failed = system ("./bootstrap"); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
146 if failed |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
147 cd (odir); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
148 error ("Could run bootstrap.\n"); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
149 end |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
150 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
151 [success, msg] = rmdir ("autom4te.cache", "s"); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
152 if !success |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
153 error (msg); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
154 endif |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
155 cd (odir); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
156 endif |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
157 endif |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
158 |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
159 % Remove devel, deprecated, .*ignore an others |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
160 to_erase = {"devel","deprecated",".svnignore",".hgignore",".hg_archival.txt"}; |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
161 for idir = 1:numel(to_erase) |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
162 |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
163 if has_dir (to_erase{idir}, exported) |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
164 [success, msg] = rmdir (fullfile (exported, to_erase{idir}), "s"); |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
165 if !success |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
166 error (msg); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
167 endif |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
168 elseif has_file (to_erase{idir}, exported) |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
169 delete (fullfile (exported, to_erase{idir})); |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
170 endif |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
171 endfor |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
172 |
9265 | 173 % Get package version |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
174 desc_file = textread (fullfile (exported,"DESCRIPTION"),"%s"); |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
175 [tf ind] = ismember ("Version:",desc_file); |
9265 | 176 pkgversion = desc_file{ind+1}; |
177 | |
178 % Compress package | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
179 pkgtar = sprintf ("%s-%s.tar", pkgname, pkgversion); |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
180 tar (pkgtar, pkgname_tmp); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
181 gzip (pkgtar, outpath); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
182 #delete (pkgtar); |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
183 pkgtar = fullfile (outpath, sprintf ("%s.gz", pkgtar)); |
11290 | 184 |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
185 printf ("Tared to %s\n", pkgtar); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
186 fflush (stdout); |
9265 | 187 |
12386
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
188 % Remove exported package |
53edd6206d09
releasePKG: update it to work with hg repositories. Filenames are now generated using fullfile.
jpicarbajal
parents:
11486
diff
changeset
|
189 rmdir (exported, "s"); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
190 |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
191 do_doc = input ("\nCreate documentation for Octave-Forge? [y|Yes|Y] / [n|No|N] ","s"); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
192 do_doc = strcmpi (do_doc(1),'y'); |
9265 | 193 |
194 if do_doc | |
9731 | 195 % Install package |
196 printf("Installing...\n"); | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
197 fflush (stdout); |
9731 | 198 pkg ('install', pkgtar); |
199 | |
200 | |
9265 | 201 % Load package and generate_html |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
202 printf ("Generating html...\n"); |
9265 | 203 fflush(stdout); |
204 | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
205 pkg ('load', pkgname); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
206 pkg ('load','generate_html'); |
9265 | 207 pkghtml = [pkgname '-html']; |
208 generate_package_html (pkgname, pkghtml, 'octave-forge'); | |
209 | |
210 % Compress html | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
211 htmltar = sprintf ("%s-html.tar", pkgname); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
212 tar (htmltar, pkghtml); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
213 gzip (htmltar); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
214 htmltar = sprintf ("%s.gz", htmltar); |
9265 | 215 |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
216 printf ("Documentation tared to %s\n", pkghtml); |
9265 | 217 fflush(stdout); |
218 | |
219 % md5sum | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
220 printf (["\nmd5sum for " htmltar "\n"]); |
9265 | 221 fflush (stdout); |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
222 disp ([md5sum(htmltar) " " htmltar]); |
9265 | 223 |
10058 | 224 % Uninstall package |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
225 printf ("Uninstalling...\n"); |
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
226 fflush (stdout); |
10058 | 227 pkg ('uninstall', pkgname); |
9265 | 228 |
229 endif % do_doc | |
230 | |
231 % md5sum | |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
232 printf (["\nmd5sum for " pkgtar "\n"]); |
9265 | 233 fflush (stdout); |
11006
1f9272024b4f
admin: releasePKG using tar and gzip packaged with octave. Increases protability.
jpicarbajal
parents:
10298
diff
changeset
|
234 disp ([md5sum(pkgtar) " " pkgtar]); |
9265 | 235 |
236 | |
237 endfunction | |
238 | |
239 function str = checkpath (str) | |
240 if str(end) != filesep() | |
241 str = [str filesep()]; | |
242 end | |
243 endfunction | |
244 | |
245 function tf = checkrepopath (str) | |
246 | |
247 if !ischar (str) | |
248 tf = false; | |
249 elseif isempty (str) | |
250 error ([' If no path to the local Octave-Forge repository is given, ' ... | |
251 'the environment variable OFPATH should be set. ' | |
252 'Use setenv("OFPATH", path-to-repo) to set it.']) | |
253 tf = false; | |
254 else | |
255 tf = true; | |
256 end | |
257 | |
258 endfunction | |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
259 |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
260 function tf = has_dir (ddir, exported) |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
261 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
262 s = dir (exported); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
263 tf = any (cellfun (@(x) strcmpi (x,ddir), {s([s.isdir]).name})); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
264 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
265 endfunction |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
266 |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
267 function tf = has_file (dfile, ddir) |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
268 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
269 s = dir (ddir); |
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
270 tf = any (cellfun (@(x) strcmpi (x,dfile), {s(![s.isdir]).name})); |
12669
1c92b4b26ced
releasePKG.m: exclude .hg* files of export as of bug #45669
jpicarbajal
parents:
12608
diff
changeset
|
271 |
11486
afb305a7c4f1
admin: releasePKG removes unnecessary folders
jpicarbajal
parents:
11290
diff
changeset
|
272 endfunction |