Index: /issm/trunk/externalpackages/m2html/m2html.m.patch
===================================================================
--- /issm/trunk/externalpackages/m2html/m2html.m.patch	(revision 9316)
+++ /issm/trunk/externalpackages/m2html/m2html.m.patch	(revision 9317)
@@ -1,35 +1,114 @@
-308a309,322
-> 
-> 	%add root directories
-> 	for i=1:length(mdir)
-> 		path=strsplit(mdir{i},'/');
-> 		string=path{1};
-> 		mdir{end+1}=string;
-> 		for j=2:length(path),
-> 			string=[string '/' path{j}];
-> 			mdir{end+1}=string;
-> 		end
-> 	end
-> 
-> 	mdir=unique(mdir);
-> 
-558c572
-< 	d = {d{~ismember(d,{'.' '..'})}};
----
-> 	d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
-690c704
-< 			eval(['!' dot_exec ' -Tcmap -Tpng ' mdotfile ...
----
-> 			eval(['!' dot_exec ' -Tcmap -Tgif ' mdotfile ...
-692c706
-< 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.png'])])
----
-> 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.gif'])])
-703c717
-< 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.png']);
----
-> 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.gif']);
-1035c1049
-< 				d = {d{~ismember(d,{'.' '..'})}};
----
-> 				d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
+*** m2html.m	2011-08-12 10:57:45.000000000 -0700
+--- install/m2html.m	2011-08-12 10:58:26.000000000 -0700
+***************
+*** 306,311 ****
+--- 306,325 ----
+  	end
+  
+  	mdir = unique(mdirs);
++ 
++ 	%add root directories
++ 	for i=1:length(mdir)
++ 		path=strsplit(mdir{i},'/');
++ 		string=path{1};
++ 		mdir{end+1}=string;
++ 		for j=2:length(path),
++ 			string=[string '/' path{j}];
++ 			mdir{end+1}=string;
++ 		end
++ 	end
++ 
++ 	mdir=unique(mdir);
++ 
+  	if options.verbose,
+  		fprintf('Found %d unique Matlab directories.\n',length(mdir));
+  	end
+***************
+*** 423,429 ****
+  %- Set some template variables
+  tpl = set(tpl,'var','DATE',[datestr(now,8) ' ' datestr(now,1) ' ' ...
+  							datestr(now,13)]);
+! tpl = set(tpl,'var','MASTERPATH',       './');
+  tpl = set(tpl,'var','DIRS',    sprintf('%s ',mdir{:}));
+  
+  %- Print list of unique directories
+--- 437,443 ----
+  %- Set some template variables
+  tpl = set(tpl,'var','DATE',[datestr(now,8) ' ' datestr(now,1) ' ' ...
+  							datestr(now,13)]);
+! tpl = set(tpl,'var','MASTERPATH',       '');
+  tpl = set(tpl,'var','DIRS',    sprintf('%s ',mdir{:}));
+  
+  %- Print list of unique directories
+***************
+*** 555,561 ****
+  	tpl = set(tpl,'var','subfold','');
+  	d = dir(mdir{i});
+  	d = {d([d.isdir]).name};
+! 	d = {d{~ismember(d,{'.' '..'})}};
+  	for j=1:length(d)
+  		if ismember(fullfile(mdir{i},d{j}),mdir)
+  			tpl = set(tpl,'var','SUBDIRECTORY',...
+--- 569,575 ----
+  	tpl = set(tpl,'var','subfold','');
+  	d = dir(mdir{i});
+  	d = {d([d.isdir]).name};
+! 	d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
+  	for j=1:length(d)
+  		if ismember(fullfile(mdir{i},d{j}),mdir)
+  			tpl = set(tpl,'var','SUBDIRECTORY',...
+***************
+*** 687,695 ****
+  % Path should look like:  ...;C:\WINNT\System32;...;C:\GraphViz\bin
+  % (Note that this should have been done automatically during GraphViz installation)
+  
+! 			eval(['!' dot_exec ' -Tcmap -Tpng ' mdotfile ...
+  				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.map']) ... 
+! 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.png'])])
+  			% use '!' rather than 'system' for backward compability
+  		catch
+  			fprintf('failed.');
+--- 701,709 ----
+  % Path should look like:  ...;C:\WINNT\System32;...;C:\GraphViz\bin
+  % (Note that this should have been done automatically during GraphViz installation)
+  
+! 			eval(['!' dot_exec ' -Tcmap -Tgif ' mdotfile ...
+  				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.map']) ... 
+! 				' -o ' fullfile(options.htmlDir,mdir{i},[dotbase '.gif'])])
+  			% use '!' rather than 'system' for backward compability
+  		catch
+  			fprintf('failed.');
+***************
+*** 700,706 ****
+  		tpl = set(tpl,'var','INDEX',[options.indexFile options.extension]);
+  		tpl = set(tpl,'var','MASTERPATH', backtomaster(mdir{i}));
+  		tpl = set(tpl,'var','MDIR',       mdir{i});
+! 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.png']);
+  		fmap = openfile(fullfile(options.htmlDir,mdir{i},[dotbase '.map']),'r');
+  		tpl = set(tpl,'var','GRAPH_MAP',  fscanf(fmap,'%c'));
+  		fclose(fmap);
+--- 714,720 ----
+  		tpl = set(tpl,'var','INDEX',[options.indexFile options.extension]);
+  		tpl = set(tpl,'var','MASTERPATH', backtomaster(mdir{i}));
+  		tpl = set(tpl,'var','MDIR',       mdir{i});
+! 		tpl = set(tpl,'var','GRAPH_IMG',  [dotbase '.gif']);
+  		fmap = openfile(fullfile(options.htmlDir,mdir{i},[dotbase '.map']),'r');
+  		tpl = set(tpl,'var','GRAPH_MAP',  fscanf(fmap,'%c'));
+  		fclose(fmap);
+***************
+*** 1032,1038 ****
+  			if recursive
+  				d = dir(mdirs{i});
+  				d = {d([d.isdir]).name};
+! 				d = {d{~ismember(d,{'.' '..'})}};
+  				for j=1:length(d)
+  					mfiles = getmfiles(cellstr(fullfile(mdirs{i},d{j})),...
+  									   mfiles,recursive);
+--- 1046,1052 ----
+  			if recursive
+  				d = dir(mdirs{i});
+  				d = {d([d.isdir]).name};
+! 				d = {d{~ismember(d,{'.' '..' 'CVS' '.svn'})}};
+  				for j=1:length(d)
+  					mfiles = getmfiles(cellstr(fullfile(mdirs{i},d{j})),...
+  									   mfiles,recursive);
