Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/tools_lgpl/matlab/quickplot/make_d3dmatlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,10 @@ function localmake(varargin)
fstrrep([targetdir,filesep,'Contents.m'], '<RELEASE>', release)
fstrrep([targetdir,filesep,'Contents.m'], '<CREATIONDATE>', DateStr) % MATLAB toolboxes don't have a time stamp

fprintf('Stripping files ...\n');
HeadURL_str = ['Source ', repo_url, ': ', hash];
Id_str = ['Release ', release, ': ', DateTimeStr];
svnstripfile(targetdir, HeadURL_str, Id_str)

%fprintf('Pcoding files ...\n');
%pmfile('dir',targetdir,targetdir,'-verbose')
fprintf('Add source information to all files ...\n');
Keywords.HeadURL = ['Source ', repo_url, ': ', hash];
Keywords.Id = ['Release ', release, ': ', DateTimeStr];
process_keywords(targetdir, Keywords)

fprintf('Cleaning up directory ...\n');
X = {'*.asv'
Expand All @@ -170,7 +167,7 @@ function exportsrc(sourcedir,targetdir)
target = [targetdir filesep d(i).name];
if d(i).isdir
switch d(i).name
case {'.','..','.svn'}
case {'.','..'}
% skip
otherwise
mkdir(target);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
function svnstripfile(basedir, varargin)
%SVNSTRIPFILE Strip $-sign from SVN keywords in files.
% SVNSTRIPFILE(BaseDir) recursively processes all .m, .c and .cpp files in
% the directory BaseDir and below, stripping away the $-signs from the SVN
% keywords HeadURL and Id (more keywords can easily be added).
%
% This tool should be run after checking out source code maintained in one
% location before committing it to another subversion location for
% distribution. If the $-signs are not stripped, then there is a fair chance
% that the revision data is used from the second location rather than the
% information from the first location where the code is actually maintained.
function process_keywords(basedir, varargin)
%PROCESS_KEYWORDS Replace keywords by strings
% PROCESS_KEYWORDS(BaseDir,KeywordValues) recursively processes all .m, .c
% and .cpp files in the directory BaseDir and below, replacing the keywords
% specified as fields in KeywordValues by the string value assigned to those
% fields.

%----- LGPL --------------------------------------------------------------------
%
Expand Down Expand Up @@ -40,7 +35,6 @@ function svnstripfile(basedir, varargin)
% $HeadURL$
% $Id$

nstrings = length(varargin);
d = dir(basedir);
for i = 1:length(d)
if d(i).isdir
Expand All @@ -53,7 +47,7 @@ function svnstripfile(basedir, varargin)
%
% recursive processing of child directories
%
svnstripfile([basedir filesep d(i).name],varargin{:})
process_keywords([basedir filesep d(i).name],varargin{:})
else
[p,f,e] = fileparts(d(i).name);
if ~strcmp(e,'.m') && ~strcmp(e,'.c') && ~strcmp(e,'.cpp') && ~strcmp(e,'.ini')
Expand All @@ -77,20 +71,18 @@ function svnstripfile(basedir, varargin)
end
fclose(fid);
%
% filter lines
% process the keywords
%
Keywords = {'HeadURL','Id'};
ValueOf = varargin{1};
Keywords = fieldnames(ValueOf);
for l = 1:length(c)
for k = 1:length(Keywords)
j = strfind(c{l},['$' Keywords{k}]);
keyword = Keywords{k};
j = strfind(c{l},['$' keyword]);
if ~isempty(j)
j2 = strfind(c{l},'$');
j2 = min(j2(j2>j));
if k > nstrings
c{l} = [c{l}(1:j-1) c{l}(j+1:j2-1) c{l}(j2+1:end)];
else
c{l} = [c{l}(1:j-1) varargin{k} c{l}(j2+1:end)];
end
c{l} = [c{l}(1:j-1) ValueOf.(keyword) c{l}(j2+1:end)];
end
end
end
Expand Down
Loading
Loading