From 58ab9c4292de9d0724de0543a9812e3b2fb92fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20M=C3=BCller-Schrader?= Date: Fri, 8 Apr 2022 20:06:02 +0200 Subject: [PATCH] Have auxTools which are always added and marked as dependency --- misc/tapas_check_for_new_release.m | 2 +- misc/tapas_get_toolbox_infos.m | 4 +++- misc/tapas_init_toolboxes.m | 13 ++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/misc/tapas_check_for_new_release.m b/misc/tapas_check_for_new_release.m index b170f480..60f82a70 100644 --- a/misc/tapas_check_for_new_release.m +++ b/misc/tapas_check_for_new_release.m @@ -36,7 +36,7 @@ if verbose % Show info if ~haveNewerRelease - fprintf(1, 'Your TAPAS version is up-to-date .\n\n'); + fprintf(1, 'Your TAPAS version is up-to-date.\n\n'); else fprintf(1, ['There is a new TAPAS release available (installed %s /'... +'newest %s)!\n\n'],offline_version,online_version); diff --git a/misc/tapas_get_toolbox_infos.m b/misc/tapas_get_toolbox_infos.m index f6dd5b48..497d8b37 100644 --- a/misc/tapas_get_toolbox_infos.m +++ b/misc/tapas_get_toolbox_infos.m @@ -1,4 +1,4 @@ -function infos = tapas_get_toolbox_infos() +function [infos, auxillary_toolboxes] = tapas_get_toolbox_infos() % Function storing information regarding toolboxes. % % Each toolbox is represented by a field with its lower-case-name. @@ -58,6 +58,8 @@ infos.external.diagnose_files = ''; infos = tapas_default_toolbox_info(infos,'tools'); % Want to have that? + + auxillary_toolboxes = {'external','tools'}; % Just inform - let init decide what to do end diff --git a/misc/tapas_init_toolboxes.m b/misc/tapas_init_toolboxes.m index 434e4a01..cefe72d5 100644 --- a/misc/tapas_init_toolboxes.m +++ b/misc/tapas_init_toolboxes.m @@ -41,14 +41,14 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages) % In the infos struct, we have all information about our toolboxes (which ones % we have, what other TAPAS toolboxes they depend on and whether they have a % init function): -infos = tapas_get_toolbox_infos(); +[infos,aux_tools] = tapas_get_toolbox_infos(); % Strategy: Use fieldnames of struct for list of toolboxes. Have boolean array, % whether to add them. toolbox_names = fieldnames(infos); if doInitAll % That's easy: Just add all. doInit = ones(size(toolbox_names),'logical'); - toolboxes = toolbox_names; + toolboxes = toolbox_names(~ismember(toolbox_names,aux_tools)); else doInit = zeros(size(toolbox_names),'logical'); for iTool = 1:numel(toolboxes) % These are to add (input argument) @@ -66,6 +66,9 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages) end % Now that we know, which toolboxes (including dependencies) we want to add, % we can do that. +doInit(ismember(toolbox_names,aux_tools)) = true; % Always add these. + + for iTool = 1:numel(toolbox_names) % Now we are iterating over all toolboxes. if doInit(iTool) sTool = toolbox_names{iTool}; @@ -79,7 +82,11 @@ function tapas_init_toolboxes(toolboxes,tdir,doShowMessages) str(end+1:80+17) = '~'; % 17 for fprintf(1,'%s\n',str); else - fprintf(1,'===== Adding dependent toolbox %s =====\n',sTool); + %fprintf(1,'===== Adding dependent toolbox %s =====\n',sTool); + str = sprintf(['~~~~~~~~~~~~~~~~~~~~~~~~ ADDING DEPENDENCY ',... + '%s ~~~~~~~~~~~~~~~~~~~~~~~~'],upper(sTool)); + str(end+1:80) = '~'; + fprintf(1,'%s\n',str); end end % If no init function is specified, we add the "genpath(init_dir)".