diff --git a/doc/installation/checkFunctionUniqueness.html b/doc/installation/checkFunctionUniqueness.html index ad22f841..a2075ffe 100644 --- a/doc/installation/checkFunctionUniqueness.html +++ b/doc/installation/checkFunctionUniqueness.html @@ -79,78 +79,83 @@

SOURCE CODE ^else -0026 altDirs = strsplit(altDirs,';')'; -0027 ravenFunctions={}; -0028 for i=1:numel(altDirs) -0029 temp_res=dir(fullfile(char(altDirs(i)),'*.m')); -0030 ravenFunctions = [ravenFunctions, temp_res.name]; -0031 end -0032 ravenFunctions=ravenFunctions'; -0033 ravenDir=altDirs; -0034 end -0035 -0036 %startup.m is not a normal function, any startup.m in the path should run -0037 %during startup, so duplicate use of this name is fine -0038 ravenFunctions=ravenFunctions(~ismember(ravenFunctions,'startup.m')); -0039 -0040 %Getting all the paths added to Matlab -0041 if ispc -0042 matlabPaths=regexp(path, ';', 'split')'; -0043 elseif isunix -0044 matlabPaths=regexp(path, ':', 'split')'; -0045 end -0046 -0047 overlapPath={}; -0048 overlapFunctions={}; -0049 multiRaven=false; -0050 multiFunction=false; +0026 if ispc +0027 splitChar = ';'; +0028 else +0029 splitChar = ':'; +0030 end +0031 altDirs = strsplit(altDirs,splitChar)'; +0032 ravenFunctions={}; +0033 for i=1:numel(altDirs) +0034 temp_res=dir(fullfile(char(altDirs(i)),'*.m')); +0035 ravenFunctions = [ravenFunctions, temp_res.name]; +0036 end +0037 ravenFunctions=ravenFunctions'; +0038 ravenDir=altDirs; +0039 end +0040 +0041 %startup.m is not a normal function, any startup.m in the path should run +0042 %during startup, so duplicate use of this name is fine +0043 ravenFunctions=ravenFunctions(~ismember(ravenFunctions,'startup.m')); +0044 +0045 %Getting all the paths added to Matlab +0046 if ispc +0047 matlabPaths=regexp(path, ';', 'split')'; +0048 elseif isunix +0049 matlabPaths=regexp(path, ':', 'split')'; +0050 end 0051 -0052 for i=1:numel(matlabPaths) -0053 if ~startsWith(matlabPaths{i},ravenDir) -0054 temp_res=dir([matlabPaths{i} '/*.m']); -0055 if ~isempty(temp_res) -0056 pathFunctions={temp_res.name}'; -0057 else -0058 pathFunctions=''; -0059 end -0060 if ~isempty(pathFunctions) && ~any(ismember('Contents.m',pathFunctions)) -0061 if any(ismember(ravenFunctions,pathFunctions)) -0062 if sum(ismember(ravenFunctions,pathFunctions))>(numel(ravenFunctions)/4) -0063 multiRaven=true; -0064 else -0065 multiFunction=true; -0066 overlapPath = [overlapPath, matlabPaths(i)]; -0067 overlapFunctions = [overlapFunctions, {ravenFunctions(ismember(ravenFunctions,pathFunctions))}]; -0068 end -0069 end -0070 end -0071 end -0072 end -0073 -0074 if multiRaven==true || multiFunction == true -0075 if nargout > 0 -0076 status = false; -0077 else -0078 fprintf('Fail\n') -0079 end -0080 if multiRaven==true && nargin < 1 -0081 error(['Multiple RAVEN versions detected in MATLAB path. Remove all ',... -0082 'RAVEN directories from the MATLAB path with removeRavenFromPath(), ',... -0083 'or manually remove them. Afterwards, re-run checkInstallation']); -0084 elseif multiFunction == true -0085 for i=1:numel(overlapPath) -0086 fprintf([' Duplicate functions in ',regexprep(overlapPath{i},'(\\)','\\$1'),'\n']); -0087 fprintf([' ' strjoin(overlapFunctions{i},'\n ') '\n']); -0088 end -0089 fprintf(' Resolve conflicting functions to avoid unexpected behaviour\n'); -0090 end -0091 else -0092 if nargout > 0 -0093 status = true; -0094 else -0095 fprintf('Pass\n') -0096 end -0097 end +0052 overlapPath={}; +0053 overlapFunctions={}; +0054 multiRaven=false; +0055 multiFunction=false; +0056 +0057 for i=1:numel(matlabPaths) +0058 if ~startsWith(matlabPaths{i},ravenDir) +0059 temp_res=dir([matlabPaths{i} '/*.m']); +0060 if ~isempty(temp_res) +0061 pathFunctions={temp_res.name}'; +0062 else +0063 pathFunctions=''; +0064 end +0065 if ~isempty(pathFunctions) && ~any(ismember('Contents.m',pathFunctions)) +0066 if any(ismember(ravenFunctions,pathFunctions)) +0067 if sum(ismember(ravenFunctions,pathFunctions))>(numel(ravenFunctions)/4) +0068 multiRaven=true; +0069 else +0070 multiFunction=true; +0071 overlapPath = [overlapPath, matlabPaths(i)]; +0072 overlapFunctions = [overlapFunctions, {ravenFunctions(ismember(ravenFunctions,pathFunctions))}]; +0073 end +0074 end +0075 end +0076 end +0077 end +0078 +0079 if multiRaven==true || multiFunction == true +0080 if nargout > 0 +0081 status = false; +0082 else +0083 fprintf('Fail\n') +0084 end +0085 if multiRaven==true && nargin < 1 +0086 error(['Multiple RAVEN versions detected in MATLAB path. Remove all ',... +0087 'RAVEN directories from the MATLAB path with removeRavenFromPath(), ',... +0088 'or manually remove them. Afterwards, re-run checkInstallation']); +0089 elseif multiFunction == true +0090 for i=1:numel(overlapPath) +0091 fprintf([' Duplicate functions in ',regexprep(overlapPath{i},'(\\)','\\$1'),'\n']); +0092 fprintf([' ' strjoin(overlapFunctions{i},'\n ') '\n']); +0093 end +0094 fprintf(' Resolve conflicting functions to avoid unexpected behaviour\n'); +0095 end +0096 else +0097 if nargout > 0 +0098 status = true; +0099 else +0100 fprintf('Pass\n') +0101 end +0102 end
Generated by m2html © 2005
\ No newline at end of file diff --git a/installation/checkFunctionUniqueness.m b/installation/checkFunctionUniqueness.m index 87019777..d4f9da9f 100755 --- a/installation/checkFunctionUniqueness.m +++ b/installation/checkFunctionUniqueness.m @@ -23,7 +23,12 @@ ravenFunctions={temp_res1.name,temp_res2.name}'; else - altDirs = strsplit(altDirs,';')'; + if ispc + splitChar = ';'; + else + splitChar = ':'; + end + altDirs = strsplit(altDirs,splitChar)'; ravenFunctions={}; for i=1:numel(altDirs) temp_res=dir(fullfile(char(altDirs(i)),'*.m'));